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

NameTypeDescription
spaceNameStringThe space name specified must be prefixed with the Metaspace name. Example ms.S1
compareTupleObjectThe tuple to be compared
updateTupleObjectThe tuple to be replaced if the comparison is true.
varargsObjectOptional PutOptions specified

Returns

TypeDescription
ObjectNew Tuple on success, otherwise a Tuple containing the current values from the entry.

Cautions

none