Interface UpdateOperation<K extends Comparable<K>>

Type Parameters:
K - consumed record key type
All Known Subinterfaces:
UpdateOperation.CellUpdateOperation<K,T>
Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public interface UpdateOperation<K extends Comparable<K>>
A transform that updates a record.
  • Method Details

    • apply

      Iterable<Cell<?>> apply(Record<K> t)
      Applies this transform to the given record.
      Parameters:
      t - the incoming record
      Returns:
      the resultant cells
    • install

      static <K extends Comparable<K>> UpdateOperation<K> install(Cell<?>... cells)
      Creates a transform that outputs the specified set of cells. When used to update a record, this will result in any other cells being deleted from the record.
      Type Parameters:
      K - consumed record key type
      Parameters:
      cells - cells to install
      Returns:
      a cell installing transform
    • install

      static <K extends Comparable<K>> UpdateOperation<K> install(Iterable<Cell<?>> cells)
      Creates a transform that outputs the specified set of cells. When used to update a record, this will result in any other cells being deleted from the record.
      Type Parameters:
      K - consumed record key type
      Parameters:
      cells - a non-null Iterable supplying cells to install
      Returns:
      a cell installing transform
      Throws:
      NullPointerException - if cells is null
    • custom

      static <K extends Comparable<K>> UpdateOperation<K> custom(Function<Record<K>,Iterable<Cell<?>>> custom)
      Creates a custom transform that applies the given user supplied function.
      Type Parameters:
      K - consumed record key type
      Parameters:
      custom - user transform to execute
      Returns:
      a custom transform
    • allOf

      static <K extends Comparable<K>> UpdateOperation<K> allOf(UpdateOperation.CellUpdateOperation<?,?>... transforms)
      Creates a compound transform composed of the given individual cell mutations.
      Type Parameters:
      K - consumed record key type
      Parameters:
      transforms - list of transforms to perform
      Returns:
      a compounded transform
    • allOf

      static <K extends Comparable<K>> UpdateOperation<K> allOf(List<? extends UpdateOperation.CellUpdateOperation<?,?>> transforms)
      Creates a compound transform composed of the given individual cell mutations.
      Type Parameters:
      K - consumed record key type
      Parameters:
      transforms - list of transforms to perform
      Returns:
      a compounded transform
    • write

      static <T, D extends CellDefinition<T>> UpdateOperation.WriteOperationBuilder<T,D> write(D definition)
    • write

    • write

    • write

    • write

    • write

      static <K extends Comparable<K>, T> UpdateOperation.CellUpdateOperation<K,T> write(Cell<T> cell)
      Creates a transform that writes the given cell.
      Type Parameters:
      K - consumed record key type
      T - cell type
      Parameters:
      cell - the cell to write
      Returns:
      a single cell writing transform
    • write

      static <K extends Comparable<K>, T> UpdateOperation.CellUpdateOperation<K,T> write(String cellName, T value)
      Creates a transform that writes a cell of the given name.
      Type Parameters:
      K - consumed record key type
      T - cell type
      Parameters:
      cellName - cell name
      value - cell value
      Returns:
      a single cell writing transform
    • remove

      static <K extends Comparable<K>, T> UpdateOperation.CellUpdateOperation<K,T> remove(CellDefinition<T> definition)
      Create a transform that removes a cell.
      Type Parameters:
      K - consumed record key type
      T - cell type
      Parameters:
      definition - cell definition to remove
      Returns:
      a single cell removing transform
    • input

      static <T, U, R> BiFunction<T,U,R> input(Function<T,R> function)
      Creates a bi-function that returns the result of the first argument applied to the given function.
      Type Parameters:
      T - consumed input type
      U - unconsumed input type
      R - result type
      Parameters:
      function - mapping function
      Returns:
      an input mapping bi-function
    • output

      static <T, U, R> BiFunction<T,U,R> output(Function<U,R> function)
      Creates a bi-function that returns the result of the second argument applied to the given function.
      Type Parameters:
      T - unconsumed input type
      U - consumed input type
      R - result type
      Parameters:
      function - mapping function
      Returns:
      an output mapping bi-function