TransformedResult
public abstract class TransformedResult<R extends Result>
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
or used as input to another API call using then
. It is an error to call both of these methods, or one of them multiple times, on a single instance.
See also | |
---|---|
then |
Summary
Public constructors |
---|
Public methods |
|
---|---|
abstract void |
andFinally(@NonNull ResultCallbacks<Object> callbacks) Requests that the supplied callbacks are called when the result is ready. |
abstract @NonNull TransformedResult<S> |
<S extends Result> then(@NonNull ResultTransform<Object, S> transform) Transforms the result by making another API call. |
Public constructors
Public methods
andFinally
public abstract void andFinally(@NonNull ResultCallbacks<Object> callbacks)
Requests that the supplied callbacks are called when the result is ready.
then
public abstract @NonNull TransformedResult<S> <S extends Result> then(@NonNull ResultTransform<Object, S> transform)
Transforms the result by making another API call.
If the result is successful, then onSuccess
will be called to make the additional API call that yields the transformed result. If the result is a failure, then onFailure
will be called to (optionally) allow modification of failure status.
If the result implements Releasable
, then release
will be called once the transform has been applied.
{@see PendingResult#then} for more details and sample code.