Interface EventSourcedEntity.Effect.OnSuccessBuilder<S>

    • Method Detail

      • thenReply

        <T> EventSourcedEntity.Effect<T> thenReply​(java.util.function.Function<S,​T> replyMessage)
        Reply after for example emitEvent.
        Type Parameters:
        T - The type of the message that must be returned by this call.
        Parameters:
        replyMessage - Function to create the reply message from the new state.
        Returns:
        A message reply.
      • thenReply

        <T> EventSourcedEntity.Effect<T> thenReply​(java.util.function.Function<S,​T> replyMessage,
                                                   Metadata metadata)
        Reply after for example emitEvent.
        Type Parameters:
        T - The type of the message that must be returned by this call.
        Parameters:
        replyMessage - Function to create the reply message from the new state.
        metadata - The metadata for the message.
        Returns:
        A message reply.
      • thenForward

        <T> EventSourcedEntity.Effect<T> thenForward​(java.util.function.Function<S,​ServiceCall> serviceCall)
        Create a forward reply after for example emitEvent.
        Type Parameters:
        T - The type of the message that must be returned by this call.
        Parameters:
        serviceCall - The service call representing the forward.
        Returns:
        A forward reply.
      • thenNoReply

        <T> EventSourcedEntity.Effect<T> thenNoReply()
        Create a reply that contains neither a message nor a forward nor an error.

        This may be useful for emitting effects without sending a message.

        Type Parameters:
        T - The type of the message that must be returned by this call.
        Returns:
        The reply.
      • thenAddSideEffect

        EventSourcedEntity.Effect.OnSuccessBuilder<S> thenAddSideEffect​(java.util.function.Function<S,​SideEffect> sideEffect)
        Attach the given side effect to this reply from the new state.
        Parameters:
        sideEffect - The effect to attach.
        Returns:
        A new reply with the attached effect.