Interface StateUpdater<T,S> 
- All Superinterfaces:
- Operation,- Serializable
Interface for updating state.
- 
Method SummaryModifier and TypeMethodDescriptionReturns a new state by applying the value on the current state.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 aStateUpdaterbased on an initial value of the state and a state update function.
- 
Method Details- 
ofstatic <T,S> StateUpdater<T,S> of(S initialValue, BiFunction<? super S, ? super T, ? extends S> stateUpdateFn) A static factory to create aStateUpdaterbased on an initial value of the state and a state update function.- Parameters:
- initialValue- the intial value of the state
- stateUpdateFn- the state update function
- Returns:
- the StateUpdater
 
- 
initS init()The initial value of the state to start with.- Returns:
- the initial value of the state
 
- 
applyReturns a new state by applying the value on the current state.- Parameters:
- state- the current state
- value- the value
- Returns:
- the new state
 
 
-