StateT
- The type of state it generates updates for.ReturnT
- The type of the result returned.@FunctionalInterface public static interface StateSynchronizer.UpdateGeneratorFunction<StateT extends Revisioned,ReturnT> extends java.util.function.BiFunction<StateT,java.util.List<Update<StateT>>,ReturnT>
StateSynchronizer.UpdateGenerator
but it also returns a result for the caller.
For example:
boolean updated = stateSynchronizer.updateState((state, updates) -> {
if (!shouldUpdate(state)) {
return false;
}
updates.addAll(findUpdatesForState(state));
return true;
});