Interface MessageBase<T>

  • Type Parameters:
    T - Payload type.
    All Known Subinterfaces:
    Message<T>, Response<T>, ResponsePart<T>

    public interface MessageBase<T>
    Base interface for messages.
    • Method Detail

      • payload

        T payload()
        Returns the payload of this message.
        Returns:
        Payload.
      • payload

        <P extends T> P payload​(Class<P> type)
        Casts the payload of this message to the specified type.
        Type Parameters:
        P - Payload type.
        Parameters:
        type - Payload type.
        Returns:
        Payload.
        Throws:
        ClassCastException - If payload can't be cast to the specified type.
      • is

        boolean is​(Class<? extends T> type)
        Returns true if this message has a payload of the specified type.
        Parameters:
        type - Payload type.
        Returns:
        true if this message has a payload of the specified type.
      • endpoint

        MessagingEndpoint<T> endpoint()
        Returns the messaging endpoint of this message..
        Returns:
        Messaging endpoint.
      • channel

        default MessagingChannel<T> channel()
        Returns the messaging channel of this message.
        Returns:
        Messaging channel.
      • from

        default ClusterAddress from()
        Returns the universally unique identifier of the remote cluster node.
        Returns:
        Universally unique identifier of the remote cluster node.
        See Also:
        ClusterNode.id()