Interface InitialUpdate<StateT extends Revisioned>

  • Type Parameters:
    StateT - A revisioned object that updates to are coordinated with a StateSynchronizer.
    All Superinterfaces:
    Update<StateT>

    public interface InitialUpdate<StateT extends Revisioned>
    extends Update<StateT>
    A constructor for a StateT object.
    • Method Detail

      • create

        StateT create​(java.lang.String scopedStreamName,
                      Revision revision)
        Returns an object of type StateT with the provided revision.
        Parameters:
        scopedStreamName - The name of the stream that this state is associated with.
        revision - The revision to use
        Returns:
        A revisioned state object
      • applyTo

        default StateT applyTo​(StateT oldState,
                               Revision newRevision)
        Description copied from interface: Update
        Return an object of type StateT that is the same as oldState with this update applied to it. Invoking Revisioned.getRevision() on the result should return newRevision.
        Specified by:
        applyTo in interface Update<StateT extends Revisioned>
        Parameters:
        oldState - The state to which should be used as the basis for the new state.
        newRevision - The revision for the new state.
        Returns:
        A state that represents a state with this update applied to it. (If StateT is mutable and the update is done in-place this is the same object as oldState)