T - the generic type of the output valueA - the generic type of the message attributespublic class Result<T,A> extends Object
MediaType.
The getOutput() value is always taken at face value, meaning that
if it's null, then the value that the operation returns to the runtime
will in fact be null. However, if the getAttributes() or
getMediaType() are Optional.empty(), then the runtime will interpret
that as the operation not interested in setting those values, keeping the input message's
attributes and/or media type untouched.
| Modifier and Type | Class and Description |
|---|---|
static class |
Result.Builder<T,A>
Builds instances of
Result |
| Modifier | Constructor and Description |
|---|---|
protected |
Result() |
| Modifier and Type | Method and Description |
|---|---|
static <T,A> Result.Builder<T,A> |
builder()
Creates a new
Result.Builder |
static <T,A> Result.Builder<T,A> |
builder(org.mule.runtime.api.message.Message muleMessage)
Creates a new
Result.Builder initialises with a state that matched
the one of the given muleMessage |
Result.Builder<T,A> |
copy()
Creates a new
Result.Builder initialises with a state that matched
this result |
Optional<A> |
getAttributes()
The new value that the operation wants to set on
Message.getAttributes(). |
Optional<org.mule.runtime.api.metadata.MediaType> |
getAttributesMediaType()
The new
MediaType that the operation wants to set on Message attributes. |
OptionalLong |
getByteLength()
The length of the payload in bytes if known.
|
Optional<Long> |
getLength()
Deprecated.
Use
getByteLength() instead. |
Optional<org.mule.runtime.api.metadata.MediaType> |
getMediaType()
The new
MediaType that the operation wants to set on Message payload. |
T |
getOutput() |
public static <T,A> Result.Builder<T,A> builder()
Result.BuilderT - the generic type of the output valueA - the generic type of the message attributesResult.Builderpublic static <T,A> Result.Builder<T,A> builder(org.mule.runtime.api.message.Message muleMessage)
Result.Builder initialises with a state that matched
the one of the given muleMessageT - the generic type of the output valueA - the generic type of the message attributesmuleMessage - a reference MessageResult.Builderpublic Result.Builder<T,A> copy()
Result.Builder initialises with a state that matched
this resultResult.Builderpublic T getOutput()
public Optional<A> getAttributes()
Message.getAttributes().
The operation might not be interested in changing that value, in which case
this method would return Optional.empty()
Optional Attributes valuepublic Optional<org.mule.runtime.api.metadata.MediaType> getMediaType()
MediaType that the operation wants to set on Message payload.
The operation might not be interested in changing that value, in which case
this method would return Optional.empty()
Optional MediaType value@Deprecated public Optional<Long> getLength()
getByteLength() instead.Optional payload lengthpublic OptionalLong getByteLength()
Optional payload lengthpublic Optional<org.mule.runtime.api.metadata.MediaType> getAttributesMediaType()
MediaType that the operation wants to set on Message attributes.
The operation might not be interested in changing that value, in which case
this method would return Optional.empty()
Optional MediaType valueCopyright © 2020 MuleSoft, Inc.. All rights reserved.