Represents a pending result that has been transformed by one or more subsequent API calls.
The result can either be consumed by callbacks set using
andFinally(ResultCallbacks super R>
)
or used as input to another API call using
then(ResultTransform super R,? extends S>
)
.It is an error to call both of these methods, or one of them multiple times, on
a single instance.
Public Constructor Summary
Public Method Summary
abstract void |
andFinally(ResultCallbacks<? super R>
callbacks)
Requests that the supplied callbacks are called when the result is ready.
|
abstract <S extendsResult> TransformedResult<S> |
then(ResultTransform<? super R,? extends S>
transform)
Transforms the result by making another API call.
|
Inherited Method Summary
Public Constructors
publicTransformedResult()
Public Methods
public abstract voidandFinally(ResultCallbacks<? super R> callbacks)
Requests that the supplied callbacks are called when the result is ready.
public abstractTransformedResult<S> then(ResultTransform<? super R,? extends S> transform)
Transforms the result by making another API call.
If the result is successful, then
ResultTransform.onSuccess(R)
will be called to make the additional API call
that yields the transformed result. If the result is a failure, then
ResultTransform.onFailure(Status)
will be called to (optionally) allow
modification of failure status.
If the result implementsReleasable
,
thenReleasable.release()
will be called once the transform has been applied.
for more details and sample code.