Interface ValueEntity.Effect.Builder<S>

  • Type Parameters:
    S - The type of the state for this entity.
    Enclosing interface:
    ValueEntity.Effect<T>

    public static interface ValueEntity.Effect.Builder<S>
    Construct the effect that is returned by the command handler. The effect describes next processing actions, such as updating state and sending a reply.
    • Method Detail

      • reply

        <T> ValueEntity.Effect<T> reply​(T message)
        Create a message reply.
        Type Parameters:
        T - The type of the message that must be returned by this call.
        Parameters:
        message - The payload of the reply.
        Returns:
        A message reply.
      • reply

        <T> ValueEntity.Effect<T> reply​(T message,
                                        Metadata metadata)
        Create a message reply.
        Type Parameters:
        T - The type of the message that must be returned by this call.
        Parameters:
        message - The payload of the reply.
        metadata - The metadata for the message.
        Returns:
        A message reply.
      • forward

        <T> ValueEntity.Effect<T> forward​(ServiceCall serviceCall)
        Create a forward reply.
        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.
      • error

        <T> ValueEntity.Effect<T> error​(String description)
        Create an error reply.
        Type Parameters:
        T - The type of the message that must be returned by this call.
        Parameters:
        description - The description of the error.
        Returns:
        An error reply.
      • noReply

        <T> ValueEntity.Effect<T> noReply()
        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.