TaskResultContracts.GetApiTaskResult

public static abstract class TaskResultContracts.GetApiTaskResult extends ResolveApiTaskResult<T, ApiTaskResult<T>>
Known Direct Subclasses

A contract that takes a Task<T> and yields an ApiTaskResult<T> with the result and additional information about the operation.

This class abstracts common logic away from the implementer, like building errors from exceptions and intents, or relaying successful responses when a result is obtained.

Public Constructor Summary

Public Method Summary

ApiTaskResult<T>
parseResult(int resultCode, Intent intent)

Protected Method Summary

ApiTaskResult<T>
outputFromTask(Task<T> task)
Extracts a result from a given Task if it is completed successfully.
abstract T
taskResultFromIntent(Intent intent)
Extracts a result from the Intent returned by the Activity.

Inherited Method Summary

Public Constructors

public GetApiTaskResult ()

Public Methods

public ApiTaskResult<T> parseResult (int resultCode, Intent intent)

Protected Methods

protected ApiTaskResult<T> outputFromTask (Task<T> task)

Extracts a result from a given Task if it is completed successfully.

protected abstract T taskResultFromIntent (Intent intent)

Extracts a result from the Intent returned by the Activity.