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(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<MediaType> |
getAttributesMediaType()
|
OptionalLong |
getByteLength()
The length of the payload in bytes if known.
|
Optional<Long> |
getLength()
Deprecated.
Use
getByteLength() instead. |
Optional<MediaType> |
getMediaType()
|
T |
getOutput() |
public static <T,A> Result.Builder<T,A> builder()
Result.Builder
T
- the generic type of the output valueA
- the generic type of the message attributesResult.Builder
public static <T,A> Result.Builder<T,A> builder(Message muleMessage)
Result.Builder
initialises with a state that matched
the one of the given muleMessage
T
- the generic type of the output valueA
- the generic type of the message attributesmuleMessage
- a reference Message
Result.Builder
public Result.Builder<T,A> copy()
Result.Builder
initialises with a state that matched
this
resultResult.Builder
public 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<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()
@Deprecated public Optional<Long> getLength()
getByteLength()
instead.Optional
payload lengthpublic OptionalLong getByteLength()
Optional
payload lengthpublic Optional<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()
Copyright © 2018. All rights reserved.