TaskResultContracts.UnpackApiTaskResult

  • UnpackApiTaskResult is an abstract class that extends ResolveApiTaskResult and is used for contracts that need to extract a result from a Task.

  • This contract is useful when you only need the result of a task without additional operation information.

  • TaskResultContracts.GetPaymentData is a known direct subclass that uses this contract to return a PaymentData object.

  • The outputFromTask method is used to extract the result from a successfully completed Task.

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

A contract that takes a Task<T> and optionally returns its result T? if the task completes successfully.

Supports contracts that are only interested in receiving the result without any associated information about the operation.

Public Constructor Summary

Protected Method Summary

T
outputFromTask(Task<T> task)
Extracts a result from a given Task if it is completed successfully.

Inherited Method Summary

Public Constructors

public UnpackApiTaskResult ()

Protected Methods

protected T outputFromTask (Task<T> task)

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