Interface TypedContent<T,​StreamType>

  • Type Parameters:
    T - the type of the resolved data (not streamed).
    StreamType - the type of each element of the stream.
    All Superinterfaces:
    Serializable
    All Known Implementing Classes:
    ByteArrayContent, EmptyContent, ListContent, ObjectContent, StringContent

    public interface TypedContent<T,​StreamType>
    extends Serializable
    The type refers to the type of the resolved data. For example, the resolved data for StringContent is string, for ListContent is List, ObjectContent is the object type and so on. The stream type refers to the data generated by the stream. For List content the type is the type of the object in the List.
    • Method Detail

      • getType

        default Class<T> getType()
      • getMimeType

        default MimeType getMimeType()
      • data

        T data()
      • getData

        default T getData()
      • isStream

        boolean isStream()
      • consume

        void consume()
        Consumes the stream payload if it has not been consumed yet. This method might be useful to call before cloning the message. E.g the fork component uses this method before invoking fork branches with a copy of the message.