T
- the value typeS
- the state typepublic interface StateUpdater<T,S> extends Operation
Modifier and Type | Method and Description |
---|---|
S |
apply(S state,
T value)
Returns a new state by applying the value on the current state.
|
S |
init()
The initial value of the state to start with.
|
static <T,S> StateUpdater<T,S> |
of(S initialValue,
BiFunction<? super S,? super T,? extends S> stateUpdateFn)
A static factory to create a
StateUpdater based on an initial value of the state and a state update function. |
static <T,S> StateUpdater<T,S> of(S initialValue, BiFunction<? super S,? super T,? extends S> stateUpdateFn)
StateUpdater
based on an initial value of the state and a state update function.T
- the value typeS
- the state typeinitialValue
- the intial value of the statestateUpdateFn
- the state update functionStateUpdater
S init()
Copyright © 2023 The Apache Software Foundation. All rights reserved.