A builder for SharedDeviceData
instances. Acquire an instance via
SharedDeviceData.builder(String).
Public Method Summary
| SharedDeviceData |
build()
Constructs an instance of
SharedDeviceData from this builder.
|
| SharedDeviceData.Builder |
setCommissioningWindowExpirationMillis(long
commissioningWindowExpirationMillis)
Sets the expiration time of the opened commissioning window.
|
| SharedDeviceData.Builder |
setDeviceName(String deviceName)
This method 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 |
setDeviceType(int deviceType)
This method 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 |
setProductId(int productId)
Sets the device's product ID.
|
| SharedDeviceData.Builder | |
| SharedDeviceData.Builder |
setVendorId(int vendorId)
Sets the device's vendor ID.
|
Inherited Method Summary
Public Methods
public SharedDeviceData build ()
Constructs an instance of
SharedDeviceData from this builder.
Throws
| IllegalStateException | if
setDeviceName(String) was not called |
|---|---|
| IllegalStateException | if
setCommissioningWindowExpirationMillis(long) was not called |
public SharedDeviceData.Builder setCommissioningWindowExpirationMillis (long commissioningWindowExpirationMillis)
Sets the expiration time of the opened commissioning window. The time basis must be
SystemClock.elapsedRealtime().
Returns
- this builder
Throws
| IllegalArgumentException | if the value is less than zero |
|---|
public SharedDeviceData.Builder setDeviceName (String deviceName)
This method 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
Sets the user-facing name of this device.
Returns
- this builder
Throws
| IllegalArgumentException | if the device name is empty |
|---|
public SharedDeviceData.Builder setDeviceType (int deviceType)
This method 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
Sets the device's primary Matter device type.
Returns
- this builder
Throws
| IllegalArgumentException | if the value is not in [0,FFFF] |
|---|
public SharedDeviceData.Builder setProductId (int productId)
Sets the device's product ID.
Returns
- this builder
Throws
| IllegalArgumentException | if the value is not in [0,FFFF] |
|---|
public SharedDeviceData.Builder setRoomName (String roomName)
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
- this builder
public SharedDeviceData.Builder setVendorId (int vendorId)
Sets the device's vendor ID.
Returns
- this builder
Throws
| IllegalArgumentException | if the value is not in [0,FFFF] |
|---|