Package com.terracottatech.store.async
Interface AsyncReadWriteRecordAccessor<K extends Comparable<K>>
- All Superinterfaces:
AsyncReadRecordAccessor<K>
public interface AsyncReadWriteRecordAccessor<K extends Comparable<K>>
extends AsyncReadRecordAccessor<K>
An asynchronous equivalent to
ReadWriteRecordAccessor
.-
Method Summary
Modifier and TypeMethodDescriptionAn asynchronous equivalent toReadWriteRecordAccessor.add(Cell...)
.An asynchronous equivalent toReadWriteRecordAccessor.add(Cell...)
.An asynchronous equivalent toReadWriteRecordAccessor.add(Function, Cell...)
.An asynchronous equivalent toReadWriteRecordAccessor.add(Function, Cell...)
.delete()
An asynchronous equivalent toReadWriteRecordAccessor.delete()
.An asynchronous equivalent toReadWriteRecordAccessor.delete(Function)
.Equivalent toReadWriteRecordAccessor.iff(Predicate)
, but returns an AsyncConditionalReadWriteRecordAccessor rather than a ConditionalReadWriteRecordAccessor.update
(UpdateOperation<? super K> transform) An asynchronous equivalent toReadWriteRecordAccessor.update(UpdateOperation)
.update
(UpdateOperation<? super K> transform, BiFunction<? super Record<K>, ? super Record<K>, T> mapper) An asynchronous equivalent toReadWriteRecordAccessor.update(UpdateOperation, BiFunction)
.An asynchronous equivalent toReadWriteRecordAccessor.upsert(Cell...)
.An asynchronous equivalent toReadWriteRecordAccessor.upsert(Iterable)
.Methods inherited from interface com.terracottatech.store.async.AsyncReadRecordAccessor
read
-
Method Details
-
iff
Equivalent toReadWriteRecordAccessor.iff(Predicate)
, but returns an AsyncConditionalReadWriteRecordAccessor rather than a ConditionalReadWriteRecordAccessor.- Specified by:
iff
in interfaceAsyncReadRecordAccessor<K extends Comparable<K>>
- Parameters:
predicate
- the predicate to apply to the record held against the key used to create this AsyncReadWriteRecordAccessor.- Returns:
- an AsyncConditionalReadWriteRecordAccessor
-
upsert
An asynchronous equivalent toReadWriteRecordAccessor.upsert(Cell...)
.- Parameters:
cells
- the cells to ensure are on the record- Returns:
- an operation representing the upsert execution
-
upsert
An asynchronous equivalent toReadWriteRecordAccessor.upsert(Iterable)
.- Parameters:
cells
- a non-null
Iterable
supplying the cells to ensure are on the record- Returns:
- an operation representing the upsert execution
- Throws:
NullPointerException
- ifcells
isnull
-
add
An asynchronous equivalent toReadWriteRecordAccessor.add(Function, Cell...)
. An exception thrown frommapper
is propagated to the caller of theadd
method. The status of the add operation is unaffected by the failure ofmapper
.- Type Parameters:
T
- the type returned by the function defined in the mapper parameter.- Parameters:
mapper
- function to apply to the record held against the key used to create this ReadWriteRecordAccessor, if such a record existed already.cells
- cells which form the record.- Returns:
- an operation representing the add.
-
add
default <T> Operation<Optional<T>> add(Function<? super Record<K>, T> mapper, Iterable<Cell<?>> cells) An asynchronous equivalent toReadWriteRecordAccessor.add(Function, Cell...)
. An exception thrown frommapper
is propagated to the caller of theadd
method. The status of the add operation is unaffected by the failure ofmapper
.- Type Parameters:
T
- the type returned by the function defined in the mapper parameter.- Parameters:
mapper
- function to apply to the record held against the key used to create this ReadWriteRecordAccessor, if such a record existed already.cells
- a non-null
Iterable
supplying the cells which form the record- Returns:
- an operation representing the add.
- Throws:
NullPointerException
- ifcells
isnull
-
add
An asynchronous equivalent toReadWriteRecordAccessor.add(Cell...)
.- Parameters:
cells
- cells which form the record.- Returns:
- an operation representing the add.
-
add
An asynchronous equivalent toReadWriteRecordAccessor.add(Cell...)
.- Parameters:
cells
- a non-null
Iterable
supplying the cells which form the record- Returns:
- an operation representing the add.
- Throws:
NullPointerException
- ifcells
isnull
-
update
default <T> Operation<Optional<T>> update(UpdateOperation<? super K> transform, BiFunction<? super Record<K>, ? super Record<K>, T> mapper) An asynchronous equivalent toReadWriteRecordAccessor.update(UpdateOperation, BiFunction)
. An exception thrown frommapper
is propagated to the caller of theupdate
method. The status of the update operation is unaffected by the failure ofmapper
.- Type Parameters:
T
- the type returned by the function defined in the mapper parameter.- Parameters:
transform
- the mutating transformation to apply to the recordmapper
- 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 toReadWriteRecordAccessor.update(UpdateOperation)
.- Parameters:
transform
- the mutating transformation to apply to the record- Returns:
- an operation representing the update.
-
delete
An asynchronous equivalent toReadWriteRecordAccessor.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
- function to apply to the deleted record.- Returns:
- an operation representing the delete.
-
delete
An asynchronous equivalent toReadWriteRecordAccessor.delete()
.- Returns:
- an operation representing the delete.
-