Class CommandHandlerBuilderByState$


  • public class CommandHandlerBuilderByState$
    extends java.lang.Object
    param: stateClass The handlers defined by this builder are used when the state is an instance of the stateClass
    • Constructor Detail

      • CommandHandlerBuilderByState$

        public CommandHandlerBuilderByState$()
    • Method Detail

      • builder

        public <Command,​Event,​S extends State,​State> CommandHandlerBuilderByState<Command,​Event,​S,​State> builder​(java.lang.Class<S> stateClass)
        Parameters:
        stateClass - The handlers defined by this builder are used when the state is an instance of the stateClass
        Returns:
        A new, mutable, CommandHandlerBuilderByState
      • builder

        public <Command,​Event,​State> CommandHandlerBuilderByState<Command,​Event,​State,​State> builder​(java.util.function.Predicate<State> statePredicate)
        Parameters:
        statePredicate - The handlers defined by this builder are used when the statePredicate is true, useful for example when state type is an Optional
        Returns:
        A new, mutable, CommandHandlerBuilderByState