public class DeviceTwinDevice extends Object
The object is a representation of a module twin if and only if the moduleId is set.
| Constructor and Description |
|---|
DeviceTwinDevice()
Constructor to create an instance for a device.
|
DeviceTwinDevice(String deviceId)
Constructor to create instance for a device.
|
DeviceTwinDevice(String deviceId,
String moduleId)
Constructor to create an instance for a module.
|
| Modifier and Type | Method and Description |
|---|---|
void |
clearDesiredProperties()
Clears the desired properties set so far.
|
void |
clearTags()
Clears the tags set so far.
|
void |
clearTwin()
Clear tags and desired properties set so far.
|
String |
desiredPropertiesToString()
String representation for this device containing desired properties.
|
com.microsoft.azure.sdk.iot.deps.twin.DeviceCapabilities |
getCapabilities()
Getter for capabilities.
|
Map<String,com.microsoft.azure.sdk.iot.deps.twin.ConfigurationInfo> |
getConfigurations()
Getter for configuration properties.
|
String |
getConnectionState() |
protected com.microsoft.azure.sdk.iot.deps.twin.TwinCollection |
getDesiredMap()
Getter for desired properties.
|
Set<Pair> |
getDesiredProperties()
Getter to get the desired properties setter.
|
Integer |
getDesiredPropertiesVersion()
Getter for the desired properties version.
|
String |
getDeviceId()
Getter to get the device Id.
|
String |
getDeviceScope()
The scope of the device.
|
String |
getETag()
Getter for the ETag.
|
String |
getModelId()
Getter for a model Id.
|
String |
getModuleId()
Getter to get the module Id.
|
List<String> |
getParentScopes()
The scopes of the upper level edge devices if applicable.
|
protected com.microsoft.azure.sdk.iot.deps.twin.TwinCollection |
getReportedMap()
Getter for reported properties.
|
Set<Pair> |
getReportedProperties()
Getter to get reported properties setter.
|
Integer |
getReportedPropertiesVersion()
Getter for the reported properties version.
|
Set<Pair> |
getTags()
Getter for the twin tags.
|
protected com.microsoft.azure.sdk.iot.deps.twin.TwinCollection |
getTagsMap()
Getter for tags.
|
Integer |
getTagsVersion()
Getter for the tag version.
|
Integer |
getVersion()
Getter for the twin version.
|
String |
reportedPropertiesToString()
String representation for this device containing reported properties.'
|
protected void |
setCapabilities(com.microsoft.azure.sdk.iot.deps.twin.DeviceCapabilities capabilities)
Setter for capabilities.
|
protected void |
setConfigurations(Map<String,com.microsoft.azure.sdk.iot.deps.twin.ConfigurationInfo> configurations)
Setter for configuration properties.
|
protected void |
setConnectionState(String connectionState)
Sets the connection state of the device.
|
void |
setDesiredProperties(Set<Pair> desiredProperties)
Setter for the desired properties.
|
protected void |
setDesiredProperties(com.microsoft.azure.sdk.iot.deps.twin.TwinCollection desiredProperties)
Setter for the desired properties.
|
protected void |
setDeviceScope(String deviceScope)
Sets the device scope.
|
void |
setETag(String eTag)
Setter for ETag.
|
void |
setModelId(String modelId)
Setter for a model Id
|
protected void |
setParentScopes(List<String> parentScopes)
Sets the parent scopes.
|
protected void |
setReportedProperties(com.microsoft.azure.sdk.iot.deps.twin.TwinCollection reportedProperties)
Setter for the reported properties.
|
void |
setTags(Set<Pair> tags)
Setter for twin tags.
|
protected void |
setTags(com.microsoft.azure.sdk.iot.deps.twin.TwinCollection tag)
Setter for tags.
|
String |
tagsToString()
String representation for this device containing tags.
|
String |
toString()
String representation for this device containing device Id, tags, desired and reported properties.
|
public DeviceTwinDevice()
public DeviceTwinDevice(String deviceId) throws IllegalArgumentException
deviceId - Id for this device.IllegalArgumentException - This exception is thrown if the device Id is null or emptypublic DeviceTwinDevice(String deviceId, String moduleId) throws IllegalArgumentException
deviceId - Id for this device.moduleId - Id for this device's module.IllegalArgumentException - This exception is thrown if the device id is null or empty.public String getDeviceId()
public String getModuleId()
public void setETag(String eTag) throws IllegalArgumentException
eTag - The value of the ETag.IllegalArgumentException - If the provided etag is null or empty.public String getETag()
null if not set.public Integer getVersion()
null.public void setTags(Set<Pair> tags) throws IllegalArgumentException
tags - A set of tag key/value pairs.IllegalArgumentException - This exception is thrown if the set tags is null.public void clearTags()
public Integer getTagsVersion()
Integer with the tags collection version.IllegalArgumentException - If the tags is null.public Set<Pair> getDesiredProperties()
public void setDesiredProperties(Set<Pair> desiredProperties) throws IllegalArgumentException
desiredProperties - A set of key/value pairs for desired properties.IllegalArgumentException - This exception is thrown if the set is null.public void clearDesiredProperties()
public Integer getDesiredPropertiesVersion()
Integer with the desired properties collection version.IllegalArgumentException - If the desired properties is null.public void clearTwin()
public Set<Pair> getReportedProperties()
public Integer getReportedPropertiesVersion()
Integer with the desired properties collection version.IllegalArgumentException - if the reported properties is null.protected void setReportedProperties(com.microsoft.azure.sdk.iot.deps.twin.TwinCollection reportedProperties)
reportedProperties - A map of validated key/value pairs for reported properties.protected void setDesiredProperties(com.microsoft.azure.sdk.iot.deps.twin.TwinCollection desiredProperties)
desiredProperties - A map of validated key/value pairs for desired properties.protected void setTags(com.microsoft.azure.sdk.iot.deps.twin.TwinCollection tag)
tag - A map of validated key/value pairs for tags.protected com.microsoft.azure.sdk.iot.deps.twin.TwinCollection getTagsMap()
protected com.microsoft.azure.sdk.iot.deps.twin.TwinCollection getDesiredMap()
protected com.microsoft.azure.sdk.iot.deps.twin.TwinCollection getReportedMap()
protected void setConfigurations(Map<String,com.microsoft.azure.sdk.iot.deps.twin.ConfigurationInfo> configurations)
configurations - Is the configuration properties.public Map<String,com.microsoft.azure.sdk.iot.deps.twin.ConfigurationInfo> getConfigurations()
null.protected void setCapabilities(com.microsoft.azure.sdk.iot.deps.twin.DeviceCapabilities capabilities)
capabilities - The value of capabilities.public com.microsoft.azure.sdk.iot.deps.twin.DeviceCapabilities getCapabilities()
null.public String getConnectionState()
protected void setConnectionState(String connectionState)
connectionState - The state to set.protected void setDeviceScope(String deviceScope)
deviceScope - The device scope to set.protected void setParentScopes(List<String> parentScopes)
parentScopes - The parent scopes.public String toString()
public String tagsToString()
public String desiredPropertiesToString()
public String reportedPropertiesToString()
public String getModelId()
null for a non-PnP device.
The value will be null for a PnP device until the device connects and registers with a model Id.public void setModelId(String modelId)
modelId - is the DTDL model Id of the device.public String getDeviceScope()
For more information, see this document.
public List<String> getParentScopes()
For more information, see this document.
Copyright © 2022. All rights reserved.