public static interface Message.Builder extends Message.PayloadBuilder
Message's MediaType as well as its attributes creation, either from a provided TypedValue
or constructing it internally from a given value and MediaType.#attributes(TypedValue)}, {@link #attributesValue(Object)}, {@link #attributesMediaType(MediaType)}| Modifier and Type | Method and Description |
|---|---|
Message.Builder |
attributes(TypedValue<?> typedValue)
Sets the
Message's TypedValue attributes to be built, including their value and media type. |
Message.Builder |
attributesMediaType(MediaType mediaType)
|
Message.Builder |
attributesValue(Object value)
Populates the builder from the given
value. |
Message |
build()
Builds a new
Message with the values set in this builder. |
Message.Builder |
mediaType(MediaType mediaType)
|
Message.Builder |
nullAttributesValue()
Sets a
#null value for the Message's attributes to be built. |
collectionValue, collectionValue, nullValue, payload, streamValue, valueMessage.Builder mediaType(MediaType mediaType)
mediaType - the mediaType to setNullPointerException - if the mediaType is nullMessage.Builder attributes(TypedValue<?> typedValue)
Message's TypedValue attributes to be built, including their value and media type. This should be
used when you already have a TypedValue. Alternatively, a Message can be constructed from just the
attributes value or value and mediaType component parts and the builder will generate the TypedValue. See
attributesValue(Object), attributesMediaType(MediaType).
If a mediaType or value have been previously set for the attributes then they will be overwritten.
typedValue - the attributes desiredNullPointerException - if the value is nullMessage.Builder nullAttributesValue()
#null value for the Message's attributes to be built.Message.Builder attributesValue(Object value)
value.
This method will get the type, mimeType and encoding from the given value according to its
concrete type.
value - an object instance.NullPointerException - if the value is nullMessage.Builder attributesMediaType(MediaType mediaType)
mediaType - the mediaType to setNullPointerException - if the mediaType is nullCopyright © 2017 MuleSoft, Inc.. All rights reserved.