Package com.terracottatech.store.async
Interface AsyncConditionalReadWriteRecordAccessor<K extends Comparable<K>>
- All Superinterfaces:
AsyncConditionalReadRecordAccessor<K>
public interface AsyncConditionalReadWriteRecordAccessor<K extends Comparable<K>>
extends AsyncConditionalReadRecordAccessor<K>
An asynchronous equivalent to
ConditionalReadWriteRecordAccessor
.-
Method Summary
Modifier and TypeMethodDescriptiondelete()
An asynchronous equivalent toConditionalReadWriteRecordAccessor.delete()
.An asynchronous equivalent toConditionalReadWriteRecordAccessor.delete(Function)
.update
(UpdateOperation<? super K> transform) An asynchronous equivalent toConditionalReadWriteRecordAccessor.update(UpdateOperation)
.update
(UpdateOperation<? super K> transform, BiFunction<? super Record<K>, ? super Record<K>, T> bimapper) An asynchronous equivalent toConditionalReadWriteRecordAccessor.update(UpdateOperation, BiFunction)
.Methods inherited from interface com.terracottatech.store.async.AsyncConditionalReadRecordAccessor
read, read
-
Method Details
-
update
default <T> Operation<Optional<T>> update(UpdateOperation<? super K> transform, BiFunction<? super Record<K>, ? super Record<K>, T> bimapper) An asynchronous equivalent toConditionalReadWriteRecordAccessor.update(UpdateOperation, BiFunction)
. An exception thrown frombimapper
is propagated to the caller of theupdate
method. The status of the update operation is unaffected by the failure ofbimapper
.- Type Parameters:
T
- the type returned by the function defined in the bimapper parameter.- Parameters:
transform
- the mutating transformation to apply to the recordbimapper
- the function to apply to the combination of the record that existed before the update and the record that resulted from the update. The first argument to the apply() method will be the record that existed before the update and the second argument will be the record that resulted from the update.- Returns:
- an Operation representing the update.
-
update
An asynchronous equivalent toConditionalReadWriteRecordAccessor.update(UpdateOperation)
.- Parameters:
transform
- the mutating transformation to apply to the record- Returns:
- an Operation representing the update.
-
delete
An asynchronous equivalent toConditionalReadWriteRecordAccessor.delete(Function)
. An exception thrown frommapper
is propagated to the caller of thedelete
method. The status of the delete operation is unaffected by the failure ofmapper
.- Type Parameters:
T
- the type returned by the function defined in the mapper parameter.- Parameters:
mapper
- the function to apply to the deleted record.- Returns:
- an Operation representing the delete.
-
delete
An asynchronous equivalent toConditionalReadWriteRecordAccessor.delete()
.- Returns:
- an Operation representing the delete.
-