# CommissioningWindow.Builder

public static final class **CommissioningWindow.Builder** extends [Object](https://developer.android.com/reference/java/lang/Object.html)  
Builder class to generate `https://developers.home.google.com/android/reference/com/google/android/gms/home/matter/commissioning/CommissioningWindow` instances.

### Public Constructor Summary

|---|---|
|   | [Builder](https://developers.home.google.com/android/reference/com/google/android/gms/home/matter/commissioning/CommissioningWindow.Builder#Builder())() |

### Public Method Summary

|---|---|
| [CommissioningWindow](https://developers.home.google.com/android/reference/com/google/android/gms/home/matter/commissioning/CommissioningWindow) | [build](https://developers.home.google.com/android/reference/com/google/android/gms/home/matter/commissioning/CommissioningWindow.Builder#build())() Builds a new instance of `https://developers.home.google.com/android/reference/com/google/android/gms/home/matter/commissioning/CommissioningWindow` |
| [CommissioningWindow.Builder](https://developers.home.google.com/android/reference/com/google/android/gms/home/matter/commissioning/CommissioningWindow.Builder) | [setDiscriminator](https://developers.home.google.com/android/reference/com/google/android/gms/home/matter/commissioning/CommissioningWindow.Builder#setDiscriminator(com.google.android.gms.home.matter.common.Discriminator))([Discriminator](https://developers.home.google.com/android/reference/com/google/android/gms/home/matter/common/Discriminator) discriminator) Sets the `https://developers.home.google.com/android/reference/com/google/android/gms/home/matter/common/Discriminator` of the device opened for commissioning. |
| [CommissioningWindow.Builder](https://developers.home.google.com/android/reference/com/google/android/gms/home/matter/commissioning/CommissioningWindow.Builder) | [setDurationSeconds](https://developers.home.google.com/android/reference/com/google/android/gms/home/matter/commissioning/CommissioningWindow.Builder#setDurationSeconds(long))(long durationSeconds) Sets the duration of the commissioning window. |
| [CommissioningWindow.Builder](https://developers.home.google.com/android/reference/com/google/android/gms/home/matter/commissioning/CommissioningWindow.Builder) | [setPasscode](https://developers.home.google.com/android/reference/com/google/android/gms/home/matter/commissioning/CommissioningWindow.Builder#setPasscode(long))(long passcode) Sets the passcode of the device opened for commissioning. |
| [CommissioningWindow.Builder](https://developers.home.google.com/android/reference/com/google/android/gms/home/matter/commissioning/CommissioningWindow.Builder) | [setWindowOpenMillis](https://developers.home.google.com/android/reference/com/google/android/gms/home/matter/commissioning/CommissioningWindow.Builder#setWindowOpenMillis(long))(long windowOpenMillis) Sets the timestamp (in milliseconds) of when the commissioning window was opened. |

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

## Public Methods

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

Builds a new instance of `https://developers.home.google.com/android/reference/com/google/android/gms/home/matter/commissioning/CommissioningWindow`

##### Throws

| [IllegalStateException](https://developer.android.com/reference/java/lang/IllegalStateException.html) | if the device discriminator, passcode, window opened timestamp, or duration are not set. |
|---|---|

#### public [CommissioningWindow.Builder](https://developers.home.google.com/android/reference/com/google/android/gms/home/matter/commissioning/CommissioningWindow.Builder) **setDiscriminator** ([Discriminator](https://developers.home.google.com/android/reference/com/google/android/gms/home/matter/common/Discriminator) discriminator)

Sets the `https://developers.home.google.com/android/reference/com/google/android/gms/home/matter/common/Discriminator`
of the device opened for commissioning.

#### public [CommissioningWindow.Builder](https://developers.home.google.com/android/reference/com/google/android/gms/home/matter/commissioning/CommissioningWindow.Builder) **setDurationSeconds** (long durationSeconds)

Sets the duration of the commissioning window.

#### public [CommissioningWindow.Builder](https://developers.home.google.com/android/reference/com/google/android/gms/home/matter/commissioning/CommissioningWindow.Builder) **setPasscode** (long passcode)

Sets the passcode of the device opened for commissioning.

##### Throws

| [IllegalArgumentException](https://developer.android.com/reference/java/lang/IllegalArgumentException.html) | if the given passcode is not in the range of 0-99999998, or is one of the specification-defined insecure passwords (1-8, 8-1, all same digits like 11111111) |
|---|---|

#### public [CommissioningWindow.Builder](https://developers.home.google.com/android/reference/com/google/android/gms/home/matter/commissioning/CommissioningWindow.Builder) **setWindowOpenMillis** (long windowOpenMillis)

Sets the timestamp (in milliseconds) of when the commissioning window was opened.
The time basis for this value must be `https://developer.android.com/reference/android/os/SystemClock.html#elapsedRealtime()`
rather than `https://developer.android.com/reference/java/lang/System.html#currentTimeMillis()`.