- TIBCO BusinessEvents®
- ActiveSpaces(Deprecated)
- Metaspace
- Space

# Metaspace.Space.compareAndPut()

## Signature

`Object compareAndPut (String spaceName, Tuple compareTuple, Tuple updateTuple, Object... varargs)`

## Domain

ACTION

## Description

Compare the tuple in the space with the tuple passed as the compareTuple. If comparison result to True, set the tuple in the space with the specified tuple. Return the tuple that is currently in the space.

## Parameters

Name | Type | Description
--- | --- | ---
`spaceName` | `String` | The space name specified must be prefixed with the Metaspace name. Example ms.S1
`compareTuple` | `Object` | The tuple to be compared
`updateTuple` | `Object` | The tuple to be replaced if the comparison is true.
`varargs` | `Object` | Optional PutOptions specified

## Returns

Type | Description
--- | ---
`Object` | New Tuple on success, otherwise a Tuple containing the current values from the entry.

## Cautions

none