SharedDeviceData.Builder

class SharedDeviceData.Builder


A builder for SharedDeviceData instances. Acquire an instance via builder.

Summary

Public functions

SharedDeviceData!

Constructs an instance of SharedDeviceData from this builder.

SharedDeviceData.Builder!
@CanIgnoreReturnValue
setCommissioningWindowExpirationMillis(
    commissioningWindowExpirationMillis: @IntRange(from = 0) Long
)

Sets the expiration time of the opened commissioning window.

SharedDeviceData.Builder!

Sets the user-facing name of this device.

SharedDeviceData.Builder!
@CanIgnoreReturnValue
setDeviceType(deviceType: @IntRange(from = 0, to = 65535) Int)

This function is deprecated.

this field is not expected to be populated; the vendor ID and product ID can be used to map to a device type

SharedDeviceData.Builder!
@CanIgnoreReturnValue
setProductId(productId: @IntRange(from = 0, to = 65535) Int)

Sets the device's product ID.

SharedDeviceData.Builder!

Sets the user-facing name of the room in which the device is located.

SharedDeviceData.Builder!
@CanIgnoreReturnValue
setVendorId(vendorId: @IntRange(from = 0, to = 65535) Int)

Sets the device's vendor ID.

Public functions

build

fun build(): SharedDeviceData!

Constructs an instance of SharedDeviceData from this builder.

setCommissioningWindowExpirationMillis

@CanIgnoreReturnValue
fun setCommissioningWindowExpirationMillis(
    commissioningWindowExpirationMillis: @IntRange(from = 0) Long
): SharedDeviceData.Builder!

Sets the expiration time of the opened commissioning window. The time basis must be elapsedRealtime.

Returns
SharedDeviceData.Builder!

this builder

Throws
java.lang.IllegalArgumentException

if the value is less than zero

setDeviceName

@CanIgnoreReturnValue
fun setDeviceName(deviceName: String!): SharedDeviceData.Builder!

Sets the user-facing name of this device.

Returns
SharedDeviceData.Builder!

this builder

Throws
java.lang.IllegalArgumentException

if the device name is empty

setDeviceType

@CanIgnoreReturnValue
fun setDeviceType(deviceType: @IntRange(from = 0, to = 65535) Int): SharedDeviceData.Builder!

Sets the device's primary Matter device type.

Returns
SharedDeviceData.Builder!

this builder

Throws
java.lang.IllegalArgumentException

if the value is not in [0,FFFF]

setProductId

@CanIgnoreReturnValue
fun setProductId(productId: @IntRange(from = 0, to = 65535) Int): SharedDeviceData.Builder!

Sets the device's product ID.

Returns
SharedDeviceData.Builder!

this builder

Throws
java.lang.IllegalArgumentException

if the value is not in [0,FFFF]

setRoomName

@CanIgnoreReturnValue
fun setRoomName(roomName: String?): SharedDeviceData.Builder!

Sets the user-facing name of the room in which the device is located. This may be set to null if there is no room for the device.

Returns
SharedDeviceData.Builder!

this builder

setVendorId

@CanIgnoreReturnValue
fun setVendorId(vendorId: @IntRange(from = 0, to = 65535) Int): SharedDeviceData.Builder!

Sets the device's vendor ID.

Returns
SharedDeviceData.Builder!

this builder

Throws
java.lang.IllegalArgumentException

if the value is not in [0,FFFF]