Interface StateSynchronizer.UpdateGeneratorFunction<StateT extends Revisioned,​ReturnT>

  • Type Parameters:
    StateT - The type of state it generates updates for.
    ReturnT - The type of the result returned.
    All Superinterfaces:
    java.util.function.BiFunction<StateT,​java.util.List<Update<StateT>>,​ReturnT>
    Enclosing interface:
    StateSynchronizer<StateT extends Revisioned>
    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 static interface StateSynchronizer.UpdateGeneratorFunction<StateT extends Revisioned,​ReturnT>
    extends java.util.function.BiFunction<StateT,​java.util.List<Update<StateT>>,​ReturnT>
    Similar to 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;
     });
     
    • Method Summary

      • Methods inherited from interface java.util.function.BiFunction

        andThen, apply