# ApiTaskResult

public class **ApiTaskResult** extends [Object](https://developer.android.com/reference/java/lang/Object.html)  
A representation of the result of a `https://developers.google.com/android/reference/com/google/android/gms/tasks/Task`, which includes
additional information about the outcome of the execution.

### Public Constructor Summary

|---|---|
|   | [ApiTaskResult](https://developers.google.com/android/reference/com/google/android/gms/wallet/contract/ApiTaskResult#ApiTaskResult(com.google.android.gms.common.api.Status))([Status](https://developers.google.com/android/reference/com/google/android/gms/common/api/Status) status) Creates an instance of `https://developers.google.com/android/reference/com/google/android/gms/wallet/contract/ApiTaskResult` for situations when the `https://developers.google.com/android/reference/com/google/android/gms/tasks/Task` fails to return a result. |
|   | [ApiTaskResult](https://developers.google.com/android/reference/com/google/android/gms/wallet/contract/ApiTaskResult#ApiTaskResult(T,%20com.google.android.gms.common.api.Status))(T result, [Status](https://developers.google.com/android/reference/com/google/android/gms/common/api/Status) status) Creates an instance of `https://developers.google.com/android/reference/com/google/android/gms/wallet/contract/ApiTaskResult` with a result and a status. |

### Public Method Summary

|---|---|
| T | [getResult](https://developers.google.com/android/reference/com/google/android/gms/wallet/contract/ApiTaskResult#getResult())() Returns the result of the task. |
| [Status](https://developers.google.com/android/reference/com/google/android/gms/common/api/Status) | [getStatus](https://developers.google.com/android/reference/com/google/android/gms/wallet/contract/ApiTaskResult#getStatus())() Returns the status of the task. |
| [String](https://developer.android.com/reference/java/lang/String.html) | [toString](https://developers.google.com/android/reference/com/google/android/gms/wallet/contract/ApiTaskResult#toString())() |

### Inherited Method Summary

From class java.lang.Object

|---|---|
| [Object](https://developer.android.com/reference/java/lang/Object.html) | clone() |
| boolean | equals([Object](https://developer.android.com/reference/java/lang/Object.html) arg0) |
| void | finalize() |
| final [Class](https://developer.android.com/reference/java/lang/Class.html)\<?\> | getClass() |
| int | hashCode() |
| final void | notify() |
| final void | notifyAll() |
| [String](https://developer.android.com/reference/java/lang/String.html) | toString() |
| final void | wait(long arg0, int arg1) |
| final void | wait(long arg0) |
| final void | wait() |

## Public Constructors

#### public **ApiTaskResult** ([Status](https://developers.google.com/android/reference/com/google/android/gms/common/api/Status) status)

Creates an instance of `https://developers.google.com/android/reference/com/google/android/gms/wallet/contract/ApiTaskResult`
for situations when the `https://developers.google.com/android/reference/com/google/android/gms/tasks/Task` fails to
return a result.

##### Parameters

| status | a `https://developers.google.com/android/reference/com/google/android/gms/common/api/Status` object contains information about the cause of the failure. |
|---|---|

#### public **ApiTaskResult** (T result, [Status](https://developers.google.com/android/reference/com/google/android/gms/common/api/Status) status)

Creates an instance of `https://developers.google.com/android/reference/com/google/android/gms/wallet/contract/ApiTaskResult`
with a result and a status.

##### Parameters

| result | the result of the task. |
| status | a `https://developers.google.com/android/reference/com/google/android/gms/common/api/Status` object with information about the operation. |
|---|---|

## Public Methods

#### public T **getResult** ()

Returns the result of the task.

##### Returns

- The result of the task, only present if the task completed successfully.

#### public [Status](https://developers.google.com/android/reference/com/google/android/gms/common/api/Status)
**getStatus** ()

Returns the status of the task.

##### Returns

- The status of the task with information about the result of the operation.

#### public [String](https://developer.android.com/reference/java/lang/String.html) **toString** ()