Interface MessageOutgoingWithImplicitEncoding<Self>

  • Type Parameters:
    Self - Implementing class.
    All Superinterfaces:
    Message, MessageOutgoing<Self>
    All Known Subinterfaces:
    HttpServiceResponse
    All Known Implementing Classes:
    HttpConsumerRequest

    public interface MessageOutgoingWithImplicitEncoding<Self>
    extends MessageOutgoing<Self>
    An outgoing network message not explicitly required to have its encoding specified when its body is being a DtoWritable.

    That an outgoing message type implements this interface indicates that its sender is able to assign the message a suitable encoding even if none is explicitly specified by the creator of the message.

    • Method Detail

      • body

        default Self body​(DtoWritable data)
        Sets outgoing message body, replacing any previously set such.

        The provided writable data transfer object is scheduled for encoding and transmission to the message receiver. An attempt will be made to resolve a suitable encoding automatically. Please refer to the Javadoc for the @DtoWritableAs annotation for more information about writable data transfer objects.

        Parameters:
        data - Data transfer object to send to message receiver.
        Returns:
        This message.
        Throws:
        java.lang.NullPointerException - If data is null.
        See Also:
        @DtoWritableAs
      • body

        default Self body​(DtoWritable... data)
        Sets outgoing message body, replacing any previously set such.

        The provided array of writable data transfer objects is scheduled for encoding and transmission to the message receiver. An attempt will be made to resolve a suitable encoding automatically. Please refer to the Javadoc for the @DtoWritableAs annotation for more information about writable data transfer objects.

        Parameters:
        data - Array of data transfer objects to send to message receiver.
        Returns:
        This message.
        Throws:
        java.lang.NullPointerException - If data is null.
        See Also:
        @DtoWritableAs
      • body

        default <L extends java.util.List<? extends DtoWritable>> Self body​(L data)
        Sets outgoing message body, replacing any previously set such.

        The provided list of writable data transfer objects is scheduled for encoding and transmission to the message receiver. An attempt will be made to resolve a suitable encoding automatically. Please refer to the Javadoc for the @DtoWritableAs annotation for more information about writable data transfer objects.

        Parameters:
        data - List of data transfer objects to send to message receiver.
        Returns:
        This message.
        Throws:
        java.lang.NullPointerException - If data is null.
        See Also:
        @DtoWritableAs