Class Reducer<E>

  • Type Parameters:
    E - type of the state


    public abstract class Reducer<E>
    extends java.lang.Object
    Definition of a Reducer. The implementation should be able to mutate state on a provided Action.
    Each Reducer implementation is responsible for a certain type of state.
    • Constructor Summary

      Constructors 
      Constructor and Description
      Reducer() 
    • Constructor Detail

      • Reducer

        public Reducer()
    • Method Detail

      • reduce

        public abstract E reduce(E state,
                                 Action<?> action)
        Reduce state. Apply the provided action on the oldState.
        Returns:
        the new state, or null if nothing has changed
      • getInitialState

        public abstract E getInitialState()
        Returns an empty or default instance of E.
      • getStateKey

        public java.lang.String getStateKey()
        Gets a state key that's unique among all Reducer.