K
- the key type for the recordpublic interface ConditionalReadWriteRecordAccessor<K extends java.lang.Comparable<K>> extends ConditionalReadRecordAccessor<K>
Modifier and Type | Method and Description |
---|---|
java.util.Optional<Record<K>> |
delete()
Deletes the record held against the key used to create this ConditionalReadWriteRecordAccessor,
if that record matches the predicate used to create this ConditionalReadWriteRecordAccessor.
|
default <T> java.util.Optional<T> |
delete(java.util.function.Function<? super Record<K>,T> mapper)
Deletes the record held against the key used to create this ConditionalReadWriteRecordAccessor,
if that record matches the predicate used to create this ConditionalReadWriteRecordAccessor.
|
java.util.Optional<Tuple<Record<K>,Record<K>>> |
update(UpdateOperation<? super K> transform)
Updates the record held against the key used to create this ConditionalReadWriteRecordAccessor,
if that record matches the predicate used to create this ConditionalReadWriteRecordAccessor.
|
default <T> java.util.Optional<T> |
update(UpdateOperation<? super K> transform,
java.util.function.BiFunction<? super Record<K>,? super Record<K>,T> bimapper)
Updates the record held against the key used to create this ConditionalReadWriteRecordAccessor,
if that record matches the predicate used to create this ConditionalReadWriteRecordAccessor.
|
read, read
default <T> java.util.Optional<T> update(UpdateOperation<? super K> transform, java.util.function.BiFunction<? super Record<K>,? super Record<K>,T> bimapper)
T
- the type returned by the function defined in the bimapper parameter.transform
- the mutating transform 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.java.util.Optional<Tuple<Record<K>,Record<K>>> update(UpdateOperation<? super K> transform)
transform
- the mutating transform to apply to the recorddefault <T> java.util.Optional<T> delete(java.util.function.Function<? super Record<K>,T> mapper)
T
- the type returned by the function defined in the mapper parameter.mapper
- the function to apply to the deleted record.java.util.Optional<Record<K>> delete()