T - return type of the Metadata resolving operation.public interface MetadataResult<T>
MetadataKeysResolver, MetadataContentResolver
and MetadataOutputResolver results.
Allows to communicate errors without propagating exceptions to the Metadata fetching service| Modifier and Type | Method and Description |
|---|---|
static <T> MetadataResult<T> |
failure(Exception e)
Creates a failure result obtaining the information from the occurred exception
when there is no payload for the result
|
static <T> MetadataResult<T> |
failure(T payload,
Exception e)
Creates a failure result obtaining the information from the occurred exception
|
static <T> MetadataResult<T> |
failure(T newPayload,
MetadataResult<?> originalResult)
Used for transforming the payload of a result with an enriched new payload, while
preserving the original
MetadataResult information |
static <T> MetadataResult<T> |
failure(T payload,
String message,
Exception e)
Creates a failure result obtaining the information from the occurred exception
with a customized failure message
|
static <T> MetadataResult<T> |
failure(T payload,
String message,
FailureCode failure,
String reason) |
T |
get() |
Optional<MetadataFailure> |
getFailure()
If
this#isSuccess is false, then a MetadataFailure instance is provided
in order to describe the error that occurred during the invocation. |
boolean |
isSuccess() |
static <T> MetadataResult<T> |
success(T payload) |
static <T> MetadataResult<T> success(T payload)
payload - object returned by the metadata operationMetadataResult instancestatic <T> MetadataResult<T> failure(Exception e)
e - exception that produced the failing MetadataResultMetadataResult instancestatic <T> MetadataResult<T> failure(T newPayload, MetadataResult<?> originalResult)
MetadataResult informationnewPayload - object returned by the metadata operationoriginalResult - original MetadataResult containing the information to propagateMetadataResult instanceIllegalArgumentException - if the original MetadataResult was not a failurestatic <T> MetadataResult<T> failure(T payload, Exception e)
payload - object returned by the metadata operatione - exception that produced the failing MetadataResultMetadataResult instancestatic <T> MetadataResult<T> failure(T payload, String message, Exception e)
payload - object returned by the metadata operationmessage - a custom message describing the context in which the failure occurrede - exception that produced the failing MetadataResultMetadataResult instancestatic <T> MetadataResult<T> failure(T payload, String message, FailureCode failure, String reason)
payload - object returned by the metadata operationmessage - a custom message describing the context in which the failure occurredfailure - the FailureCode of the error that occurredreason - the original message of the error that produced this failureMetadataResult instanceT get()
boolean isSuccess()
Optional<MetadataFailure> getFailure()
this#isSuccess is false, then a MetadataFailure instance is provided
in order to describe the error that occurred during the invocation.List of MetadataFailures describing the errors that occurred during the invocation
if at least one occurred.Copyright © 2016 MuleSoft, Inc.. All rights reserved.