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 Details

    • iff

      Equivalent to ReadWriteRecordAccessor.iff(Predicate), but returns an AsyncConditionalReadWriteRecordAccessor rather than a ConditionalReadWriteRecordAccessor.
      Specified by:
      iff in interface AsyncReadRecordAccessor<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

      default Operation<Void> upsert(Cell<?>... cells)
      An asynchronous equivalent to ReadWriteRecordAccessor.upsert(Cell...).
      Parameters:
      cells - the cells to ensure are on the record
      Returns:
      an operation representing the upsert execution
    • upsert

      Operation<Void> upsert(Iterable<Cell<?>> cells)
      An asynchronous equivalent to ReadWriteRecordAccessor.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 - if cells is null
    • add

      default <T> Operation<Optional<T>> add(Function<? super Record<K>,T> mapper, Cell<?>... cells)
      An asynchronous equivalent to ReadWriteRecordAccessor.add(Function, Cell...).

      An exception thrown from mapper is propagated to the caller of the add method. The status of the add operation is unaffected by the failure of mapper.

      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 to ReadWriteRecordAccessor.add(Function, Cell...).

      An exception thrown from mapper is propagated to the caller of the add method. The status of the add operation is unaffected by the failure of mapper.

      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 - if cells is null
    • add

      default Operation<Optional<Record<K>>> add(Cell<?>... cells)
      An asynchronous equivalent to ReadWriteRecordAccessor.add(Cell...).
      Parameters:
      cells - cells which form the record.
      Returns:
      an operation representing the add.
    • add

      Operation<Optional<Record<K>>> add(Iterable<Cell<?>> cells)
      An asynchronous equivalent to ReadWriteRecordAccessor.add(Cell...).
      Parameters:
      cells - a non-null Iterable supplying the cells which form the record
      Returns:
      an operation representing the add.
      Throws:
      NullPointerException - if cells is null
    • update

      default <T> Operation<Optional<T>> update(UpdateOperation<? super K> transform, BiFunction<? super Record<K>,? super Record<K>,T> mapper)
      An asynchronous equivalent to ReadWriteRecordAccessor.update(UpdateOperation, BiFunction).

      An exception thrown from mapper is propagated to the caller of the update method. The status of the update operation is unaffected by the failure of mapper.

      Type Parameters:
      T - the type returned by the function defined in the mapper parameter.
      Parameters:
      transform - the mutating transformation to apply to the record
      mapper - 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

      Operation<Optional<Tuple<Record<K>,Record<K>>>> update(UpdateOperation<? super K> transform)
      Parameters:
      transform - the mutating transformation to apply to the record
      Returns:
      an operation representing the update.
    • delete

      default <T> Operation<Optional<T>> delete(Function<? super Record<K>,T> mapper)
      An asynchronous equivalent to ReadWriteRecordAccessor.delete(Function).

      An exception thrown from mapper is propagated to the caller of the delete method. The status of the delete operation is unaffected by the failure of mapper.

      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

      Operation<Optional<Record<K>>> delete()
      An asynchronous equivalent to ReadWriteRecordAccessor.delete().
      Returns:
      an operation representing the delete.