# CommissioningWindow.Builder

# CommissioningWindow.Builder


```
class CommissioningWindow.Builder
```

<br />

*** ** * ** ***

Builder class to generate `https://developers.home.google.com/reference/kotlin/com/google/android/gms/home/matter/commissioning/CommissioningWindow` instances.

## Summary

| ### Public constructors |
|---|
| `https://developers.home.google.com/reference/kotlin/com/google/android/gms/home/matter/commissioning/CommissioningWindow.Builder#Builder()()` |

| ### Public functions |
|---|---|
| `https://developers.home.google.com/reference/kotlin/com/google/android/gms/home/matter/commissioning/CommissioningWindow!` | `https://developers.home.google.com/reference/kotlin/com/google/android/gms/home/matter/commissioning/CommissioningWindow.Builder#build()()` Builds a new instance of `https://developers.home.google.com/reference/kotlin/com/google/android/gms/home/matter/commissioning/CommissioningWindow` |
| `https://developers.home.google.com/reference/kotlin/com/google/android/gms/home/matter/commissioning/CommissioningWindow.Builder!` | `@https://errorprone.info/api/latest/com/google/errorprone/annotations/CanIgnoreReturnValue.html https://developers.home.google.com/reference/kotlin/com/google/android/gms/home/matter/commissioning/CommissioningWindow.Builder#setDiscriminator(com.google.android.gms.home.matter.common.Discriminator)(discriminator: https://developers.home.google.com/reference/kotlin/com/google/android/gms/home/matter/common/Discriminator!)` Sets the `https://developers.home.google.com/reference/kotlin/com/google/android/gms/home/matter/common/Discriminator` of the device opened for commissioning. |
| `https://developers.home.google.com/reference/kotlin/com/google/android/gms/home/matter/commissioning/CommissioningWindow.Builder!` | `@https://errorprone.info/api/latest/com/google/errorprone/annotations/CanIgnoreReturnValue.html https://developers.home.google.com/reference/kotlin/com/google/android/gms/home/matter/commissioning/CommissioningWindow.Builder#setDurationSeconds(long)(durationSeconds: @https://developer.android.com/reference/androidx/annotation/IntRange.html(from = 1) https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-long/index.html)` Sets the duration of the commissioning window. |
| `https://developers.home.google.com/reference/kotlin/com/google/android/gms/home/matter/commissioning/CommissioningWindow.Builder!` | `@https://errorprone.info/api/latest/com/google/errorprone/annotations/CanIgnoreReturnValue.html https://developers.home.google.com/reference/kotlin/com/google/android/gms/home/matter/commissioning/CommissioningWindow.Builder#setPasscode(long)(passcode: @https://developer.android.com/reference/androidx/annotation/IntRange.html(from = 0, to = 99999998) https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-long/index.html)` Sets the passcode of the device opened for commissioning. |
| `https://developers.home.google.com/reference/kotlin/com/google/android/gms/home/matter/commissioning/CommissioningWindow.Builder!` | `@https://errorprone.info/api/latest/com/google/errorprone/annotations/CanIgnoreReturnValue.html https://developers.home.google.com/reference/kotlin/com/google/android/gms/home/matter/commissioning/CommissioningWindow.Builder#setWindowOpenMillis(long)(windowOpenMillis: @https://developer.android.com/reference/androidx/annotation/IntRange.html(from = 1) https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-long/index.html)` Sets the timestamp (in milliseconds) of when the commissioning window was opened. |

## Public constructors

### Builder

```
Builder()
```

## Public functions

### build

```
fun build(): CommissioningWindow!
```

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

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

### setDiscriminator

```
@CanIgnoreReturnValue
fun setDiscriminator(discriminator: Discriminator!): CommissioningWindow.Builder!
```

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

### setDurationSeconds

```
@CanIgnoreReturnValue
fun setDurationSeconds(durationSeconds: @IntRange(from = 1) Long): CommissioningWindow.Builder!
```

Sets the duration of the commissioning window.

### setPasscode

```
@CanIgnoreReturnValue
fun setPasscode(passcode: @IntRange(from = 0, to = 99999998) Long): CommissioningWindow.Builder!
```

Sets the passcode of the device opened for commissioning.

| Throws |
|---|---|
| `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) |

### setWindowOpenMillis

```
@CanIgnoreReturnValue
fun setWindowOpenMillis(windowOpenMillis: @IntRange(from = 1) Long): CommissioningWindow.Builder!
```

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()`.