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 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 |
static <T,A> Result.Builder<T,A> |
builder(Result<T,A> prototypeResult)
Creates a new
Result.Builder initialises with a state that matched
the one of the given prototypeResult |
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. |
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 static <T,A> Result.Builder<T,A> builder(Result<T,A> prototypeResult)
Result.Builder initialises with a state that matched
the one of the given prototypeResultT - the generic type of the output valueA - the generic type of the message attributesprototypeResult - a prototype 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 valuepublic 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 © 2017 MuleSoft, Inc.. All rights reserved.