Package com.terracottatech.store
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.
A transform that updates a record.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interface
A builder for a transform that writes a single boolean cell.static interface
UpdateOperation.CellUpdateOperation<K extends Comparable<K>,
T> A single cell transform.static interface
A builder for a transform that writes a single double cell.static interface
A builder for a transform that writes a single int cell.static interface
A builder for a transform that writes a single long cell.static interface
UpdateOperation.WriteOperationBuilder<T,
D extends CellDefinition<T>> A builder for a transform that writes a single cell. -
Method Summary
Modifier and TypeMethodDescriptionstatic <K extends Comparable<K>>
UpdateOperation<K>allOf
(UpdateOperation.CellUpdateOperation<?, ?>... transforms) Creates a compound transform composed of the given individual cell mutations.static <K extends Comparable<K>>
UpdateOperation<K>allOf
(List<? extends UpdateOperation.CellUpdateOperation<?, ?>> transforms) Creates a compound transform composed of the given individual cell mutations.Applies this transform to the given record.static <K extends Comparable<K>>
UpdateOperation<K>Creates a custom transform that applies the given user supplied function.static <T,
U, R> BiFunction<T, U, R> Creates a bi-function that returns the result of the first argument applied to the given function.static <K extends Comparable<K>>
UpdateOperation<K>Creates a transform that outputs the specified set of cells.static <K extends Comparable<K>>
UpdateOperation<K>Creates a transform that outputs the specified set of cells.static <T,
U, R> BiFunction<T, U, R> Creates a bi-function that returns the result of the second argument applied to the given function.static <K extends Comparable<K>,
T>
UpdateOperation.CellUpdateOperation<K,T> remove
(CellDefinition<T> definition) Create a transform that removes a cell.static <K extends Comparable<K>,
T>
UpdateOperation.CellUpdateOperation<K,T> Creates a transform that writes the given cell.write
(BoolCellDefinition definition) write
(DoubleCellDefinition definition) write
(IntCellDefinition definition) write
(LongCellDefinition definition) static <T,
D extends CellDefinition<T>>
UpdateOperation.WriteOperationBuilder<T,D> write
(D definition) static <K extends Comparable<K>,
T>
UpdateOperation.CellUpdateOperation<K,T> Creates a transform that writes a cell of the given name.
-
Method Details
-
apply
Applies this transform to the given record.- Parameters:
t
- the incoming record- Returns:
- the resultant cells
-
install
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
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
- ifcells
isnull
-
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
Creates a transform that writes the given cell.- Type Parameters:
K
- consumed record key typeT
- 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 typeT
- cell type- Parameters:
cellName
- cell namevalue
- 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 typeT
- cell type- Parameters:
definition
- cell definition to remove- Returns:
- a single cell removing transform
-
input
Creates a bi-function that returns the result of the first argument applied to the given function.- Type Parameters:
T
- consumed input typeU
- unconsumed input typeR
- result type- Parameters:
function
- mapping function- Returns:
- an input mapping bi-function
-
output
Creates a bi-function that returns the result of the second argument applied to the given function.- Type Parameters:
T
- unconsumed input typeU
- consumed input typeR
- result type- Parameters:
function
- mapping function- Returns:
- an output mapping bi-function
-