# CommissioningResult

public final class **CommissioningResult** extends [Object](https://developer.android.com/reference/java/lang/Object.html)  
implements [Parcelable](https://developer.android.com/reference/android/os/Parcelable.html) Response after commissioning a device, indicating the details of the commissioned
device.

### Nested Class Summary

|---|---|---|---|
| class | [CommissioningResult.Builder](https://developers.home.google.com/android/reference/com/google/android/gms/home/matter/commissioning/CommissioningResult.Builder) || Builder class to create instances of `https://developers.home.google.com/android/reference/com/google/android/gms/home/matter/commissioning/CommissioningResult`. |

### Inherited Constant Summary

From interface android.os.Parcelable

|---|---|---|
| int | CONTENTS_FILE_DESCRIPTOR |   |
| int | PARCELABLE_STABILITY_LOCAL |   |
| int | PARCELABLE_STABILITY_VINTF |   |
| int | PARCELABLE_WRITE_RETURN_VALUE |   |

### Public Method Summary

|---|---|
| static [CommissioningResult.Builder](https://developers.home.google.com/android/reference/com/google/android/gms/home/matter/commissioning/CommissioningResult.Builder) | [builder](https://developers.home.google.com/android/reference/com/google/android/gms/home/matter/commissioning/CommissioningResult#builder())() Returns an empty builder. |
| boolean | [equals](https://developers.home.google.com/android/reference/com/google/android/gms/home/matter/commissioning/CommissioningResult#equals(java.lang.Object))([Object](https://developer.android.com/reference/java/lang/Object.html) other) |
| static [CommissioningResult](https://developers.home.google.com/android/reference/com/google/android/gms/home/matter/commissioning/CommissioningResult) | [fromIntentSenderResult](https://developers.home.google.com/android/reference/com/google/android/gms/home/matter/commissioning/CommissioningResult#fromIntentSenderResult(int,%20android.content.Intent))(int resultCode, [Intent](https://developer.android.com/reference/android/content/Intent.html) data) Parses out the data from the `https://developers.home.google.com/android/reference/com/google/android/gms/home/matter/commissioning/CommissioningClient#commissionDevice(com.google.android.gms.home.matter.commissioning.CommissioningRequest)` `https://developer.android.com/reference/android/content/IntentSender.html` result. |
| [DeviceDescriptor](https://developers.home.google.com/android/reference/com/google/android/gms/home/matter/common/DeviceDescriptor) | [getCommissionedDeviceDescriptor](https://developers.home.google.com/android/reference/com/google/android/gms/home/matter/commissioning/CommissioningResult#getCommissionedDeviceDescriptor())() Information about the device that was commissioned. |
| [String](https://developer.android.com/reference/java/lang/String.html) | [getDeviceName](https://developers.home.google.com/android/reference/com/google/android/gms/home/matter/commissioning/CommissioningResult#getDeviceName())() The device name assigned to the device during commissioning. |
| [Room](https://developers.home.google.com/android/reference/com/google/android/gms/home/matter/commissioning/Room) | [getRoom](https://developers.home.google.com/android/reference/com/google/android/gms/home/matter/commissioning/CommissioningResult#getRoom())() *This method is deprecated. this will no longer be populated since rooms are no longer in the commissioning flow* |
| [String](https://developer.android.com/reference/java/lang/String.html) | [getToken](https://developers.home.google.com/android/reference/com/google/android/gms/home/matter/commissioning/CommissioningResult#getToken())() Returns the token supplied by your commissioning service in `https://developers.home.google.com/android/reference/com/google/android/gms/home/matter/commissioning/CommissioningCompleteMetadata.Builder#setToken(java.lang.String)`, if one was specified. |
| int | [hashCode](https://developers.home.google.com/android/reference/com/google/android/gms/home/matter/commissioning/CommissioningResult#hashCode())() |
| void | [writeToParcel](https://developers.home.google.com/android/reference/com/google/android/gms/home/matter/commissioning/CommissioningResult#writeToParcel(android.os.Parcel,%20int))([Parcel](https://developer.android.com/reference/android/os/Parcel.html) dest, int flags) |

### 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() |

From interface android.os.Parcelable

|---|---|
| abstract int | describeContents() |
| abstract void | writeToParcel([Parcel](https://developer.android.com/reference/android/os/Parcel.html) arg0, int arg1) |

## Public Methods

#### public static [CommissioningResult.Builder](https://developers.home.google.com/android/reference/com/google/android/gms/home/matter/commissioning/CommissioningResult.Builder) **builder**
()

Returns an empty builder.

#### public boolean **equals** ([Object](https://developer.android.com/reference/java/lang/Object.html) other)

#### public static [CommissioningResult](https://developers.home.google.com/android/reference/com/google/android/gms/home/matter/commissioning/CommissioningResult) **fromIntentSenderResult** (int resultCode, [Intent](https://developer.android.com/reference/android/content/Intent.html) data)

Parses out the data from the `https://developers.home.google.com/android/reference/com/google/android/gms/home/matter/commissioning/CommissioningClient#commissionDevice(com.google.android.gms.home.matter.commissioning.CommissioningRequest)` `https://developer.android.com/reference/android/content/IntentSender.html`
result. This can be called for both success and failure cases to interpret the result
data.

In a successful commissioning, a `https://developers.home.google.com/android/reference/com/google/android/gms/home/matter/commissioning/CommissioningResult` will be returned. For failure cases, an `https://developers.home.google.com/android/reference/com/google/android/gms/common/api/ApiException`
will be thrown, containing a `https://developers.home.google.com/android/reference/com/google/android/gms/common/api/Status`
which indicates the cause of the commissioning failure.

##### Parameters

| resultCode | the result code, returned by the `https://developer.android.com/reference/android/content/IntentSender.html` returned by the `https://developers.home.google.com/android/reference/com/google/android/gms/home/matter/commissioning/CommissioningClient#commissionDevice(com.google.android.gms.home.matter.commissioning.CommissioningRequest)` API |
| data | the result data, returned by the `https://developer.android.com/reference/android/content/IntentSender.html` returned by the `https://developers.home.google.com/android/reference/com/google/android/gms/home/matter/commissioning/CommissioningClient#commissionDevice(com.google.android.gms.home.matter.commissioning.CommissioningRequest)` API |
|---|---|

##### Throws

| ApiException | if the result data indicates a commissioning failure |
|---|---|

#### public [DeviceDescriptor](https://developers.home.google.com/android/reference/com/google/android/gms/home/matter/common/DeviceDescriptor)
**getCommissionedDeviceDescriptor** ()

Information about the device that was commissioned.

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

The device name assigned to the device during commissioning.

#### public [Room](https://developers.home.google.com/android/reference/com/google/android/gms/home/matter/commissioning/Room)
**getRoom** ()

**This method is deprecated.**   

this will no longer be populated since rooms are no longer in the commissioning flow
The room (if any) that was selected during commissioning.

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

Returns the token supplied by your commissioning service in `https://developers.home.google.com/android/reference/com/google/android/gms/home/matter/commissioning/CommissioningCompleteMetadata.Builder#setToken(java.lang.String)`, if one was
specified. Otherwise, returns null.

#### public int **hashCode** ()

#### public void **writeToParcel** ([Parcel](https://developer.android.com/reference/android/os/Parcel.html) dest, int flags)