public static class Device.Builder
A Builder for a Device
Constructor and Description |
---|
Builder()
A Builder for a Device
|
Modifier and Type | Method and Description |
---|---|
Device.Builder |
addOtherDeviceId(java.lang.String deviceId,
java.lang.String agentUserId)
Adds an additional device ID
|
Device.Builder |
addTrait(java.lang.String trait)
Adds a trait to the list of device traits
|
Payload.Device |
build()
Generates the underlying DeviceProto for the device
|
com.google.protobuf.Struct |
getAttributes()
Get the attributes of the device
|
java.lang.String |
getCustomData()
Gets the custom data of the device
|
NonExistentClass |
getDeviceInfo()
Gets the device info
|
java.lang.String |
getId()
Get device id
|
NonExistentClass |
getName()
Gets the names of the device
|
NonExistentClass |
getProtoBuilder() |
java.lang.String |
getRoomHint()
Gets the device room hint
|
com.google.protobuf.ProtocolStringList |
getTraits()
Get list of device traits
|
java.lang.String |
getType()
Get device type
|
boolean |
getWillReportState()
Gets whether the device will report its state
|
Device.Builder |
setAttributes(com.google.protobuf.Struct attributes)
Set the attributes of the device
|
Device.Builder |
setAttributes(org.json.JSONObject attributesJson)
Sets the attributes of the device
|
Device.Builder |
setCustomData(java.lang.String customData)
Sets the custom data of the device
|
Device.Builder |
setCustomData(org.json.JSONObject customData)
Sets the custom data of the device
|
Device.Builder |
setDeviceInfo(NonExistentClass deviceInfo)
Sets the device info
|
Device.Builder |
setDeviceInfo(java.lang.String manufacturer,
java.lang.String model,
java.lang.String hwVersion,
java.lang.String swVersion)
Sets each field of the device info
|
Device.Builder |
setId(java.lang.String id)
Set device id
|
Device.Builder |
setName(NonExistentClass name)
Sets the names of the device
|
Device.Builder |
setName(java.util.List<java.lang.String> defaultNames,
java.lang.String name,
java.util.List<java.lang.String> nicknames)
Sets each field for the names of the device
|
Device.Builder |
setOtherDeviceIds(java.util.List<? extends error.NonExistentClass> otherDeviceIds)
Sets a list of otherDeviceIds
|
void |
setProtoBuilder(NonExistentClass p) |
Device.Builder |
setRoomHint(java.lang.String roomHint)
Sets the device room hint
|
Device.Builder |
setTraits(java.util.List<java.lang.String> traits)
Sets list of device traits
|
Device.Builder |
setType(java.lang.String type)
Set device type
|
Device.Builder |
setWillReportState(boolean willReportState)
Sets whether the device will report its state
|
public NonExistentClass getProtoBuilder()
public void setProtoBuilder(NonExistentClass p)
public java.lang.String getId()
Get device id
public Device.Builder setId(java.lang.String id)
Set device id
public java.lang.String getType()
Get device type
public Device.Builder setType(java.lang.String type)
Set device type
public com.google.protobuf.ProtocolStringList getTraits()
Get list of device traits
public Device.Builder setTraits(java.util.List<java.lang.String> traits)
Sets list of device traits
public Device.Builder addTrait(java.lang.String trait)
Adds a trait to the list of device traits
public NonExistentClass getName()
Gets the names of the device
public Device.Builder setName(NonExistentClass name)
Sets the names of the device
public Device.Builder setName(java.util.List<java.lang.String> defaultNames, java.lang.String name, java.util.List<java.lang.String> nicknames)
Sets each field for the names of the device
public boolean getWillReportState()
Gets whether the device will report its state
public Device.Builder setWillReportState(boolean willReportState)
Sets whether the device will report its state
public com.google.protobuf.Struct getAttributes()
Get the attributes of the device
public Device.Builder setAttributes(com.google.protobuf.Struct attributes)
Set the attributes of the device
public Device.Builder setAttributes(org.json.JSONObject attributesJson)
Sets the attributes of the device
public java.lang.String getRoomHint()
Gets the device room hint
public Device.Builder setRoomHint(java.lang.String roomHint)
Sets the device room hint
public NonExistentClass getDeviceInfo()
Gets the device info
public Device.Builder setDeviceInfo(NonExistentClass deviceInfo)
Sets the device info
public Device.Builder setDeviceInfo(java.lang.String manufacturer, java.lang.String model, java.lang.String hwVersion, java.lang.String swVersion)
Sets each field of the device info
public java.lang.String getCustomData()
Gets the custom data of the device
public Device.Builder setCustomData(java.lang.String customData)
Sets the custom data of the device
public Device.Builder setCustomData(org.json.JSONObject customData)
Sets the custom data of the device
public Device.Builder addOtherDeviceId(java.lang.String deviceId, java.lang.String agentUserId)
Adds an additional device ID
public Device.Builder setOtherDeviceIds(java.util.List<? extends error.NonExistentClass> otherDeviceIds)
Sets a list of otherDeviceIds
public Payload.Device build()
Generates the underlying DeviceProto for the device