DeviceTwinDevice Class
- java.
lang. Object - com.
microsoft. azure. sdk. iot. service. devicetwin. DeviceTwinDevice
- com.
public class DeviceTwinDevice
The DeviceTwinDevice class represent the twin on iotHub. implementing constructors and serialization functionality. If object is a representation of the module twin if and only if the moduleId is set.
Constructor Summary
| Constructor | Description |
|---|---|
| DeviceTwinDevice() |
Constructor to create instance for a device |
| DeviceTwinDevice(String deviceId) |
Constructor to create instance for a device. |
| DeviceTwinDevice(String deviceId, String moduleId) |
Constructor to create instance for a module. |
Method Summary
| Modifier and Type | Method and Description |
|---|---|
| void |
clearDesiredProperties()
Clear desired properties set so far |
| void |
clearTags()
Clear tags set so far |
| void |
clearTwin()
Clear tags and desired properties set so far |
| java.lang.String |
desiredPropertiesToString()
String representation for this device containing desired properties |
|
Device |
getCapabilities()
Getter for capabilities |
|
java.util.Map<java.lang.String,Configuration |
getConfigurations()
Getter for the configuration properties |
| java.lang.String | getConnectionState() |
|
protected
Twin |
getDesiredMap()
Getter for the desired properties |
| java.util.Set<Pair> |
getDesiredProperties()
Getter to get Desired Properties set |
| java.lang.Integer |
getDesiredPropertiesVersion()
Getter for the desired properties version. |
| java.lang.String |
getDeviceId()
Getter to get device ID |
| java.lang.String |
getETag()
Getter for the e |
| java.lang.String | getModelId() |
| java.lang.String |
getModuleId()
Getter to get module ID |
|
protected
Twin |
getReportedMap()
Getter for the reported properties |
| java.util.Set<Pair> |
getReportedProperties()
Getter to get Reported Properties Set |
| java.lang.Integer |
getReportedPropertiesVersion()
Getter for the reported properties version. |
| java.util.Set<Pair> |
getTags()
Getter to get Tags Set |
|
protected
Twin |
getTagsMap()
Getter for the tags |
| java.lang.Integer |
getTagsVersion()
Getter for the tag version. |
| java.lang.Integer |
getVersion()
Getter for the Twin version |
| java.lang.String |
reportedPropertiesToString()
String representation for this device containing reported properties |
| protected void |
setCapabilities(DeviceCapabilities capabilities)
Setter for capabilities |
| protected void |
setConfigurations(Map<String,ConfigurationInfo> configurations)
Setter for the configuration properties |
| protected void |
setConnectionState(String connectionState)
Set the connection state of the device |
| void |
setDesiredProperties(Set<Pair> desiredProperties)
Setter for the desired properties |
| protected void |
setDesiredProperties(TwinCollection desiredProperties)
Setter for the desired properties |
| void |
setETag(String eTag)
Setter for ETag |
| void | setModelId(String modelId) |
| protected void |
setReportedProperties(TwinCollection reportedProperties)
Setter for the reported properties |
| void |
setTags(Set<Pair> tags)
Setter for the tags |
| protected void |
setTags(TwinCollection tag)
Setter for the tags |
| java.lang.String |
tagsToString()
String representation for this device containing tags |
| java.lang.String |
toString()
String representation for this device containing device id, tags, desired and reported properties |
Methods inherited from java.lang.Object
Constructor Details
DeviceTwinDevice
public DeviceTwinDevice()
Constructor to create instance for a device
DeviceTwinDevice
public DeviceTwinDevice(String deviceId)
Constructor to create instance for a device.
Parameters:
Throws:
DeviceTwinDevice
public DeviceTwinDevice(String deviceId, String moduleId)
Constructor to create instance for a module.
Parameters:
Throws:
Method Details
clearDesiredProperties
public void clearDesiredProperties()
Clear desired properties set so far
clearTags
public void clearTags()
Clear tags set so far
clearTwin
public void clearTwin()
Clear tags and desired properties set so far
desiredPropertiesToString
public String desiredPropertiesToString()
String representation for this device containing desired properties
Returns:
getCapabilities
public DeviceCapabilities getCapabilities()
Getter for capabilities
Returns:
null.getConfigurations
public Map<String,ConfigurationInfo> getConfigurations()
Getter for the configuration properties
Returns:
null.getConnectionState
public String getConnectionState()
Returns:
getDesiredMap
protected TwinCollection getDesiredMap()
Getter for the desired properties
Returns:
getDesiredProperties
public Set<Pair> getDesiredProperties()
Getter to get Desired Properties set
Returns:
getDesiredPropertiesVersion
public Integer getDesiredPropertiesVersion()
Getter for the desired properties version.
Returns:
Integer with the Desired properties Collection version.getDeviceId
public String getDeviceId()
Getter to get device ID
Returns:
getETag
public String getETag()
Getter for the eTag
Returns:
null if not set.getModelId
public String getModelId()
getModuleId
public String getModuleId()
Getter to get module ID
Returns:
getReportedMap
protected TwinCollection getReportedMap()
Getter for the reported properties
Returns:
getReportedProperties
public Set<Pair> getReportedProperties()
Getter to get Reported Properties Set
Returns:
getReportedPropertiesVersion
public Integer getReportedPropertiesVersion()
Getter for the reported properties version.
Returns:
Integer with the Desired properties Collection version.getTags
public Set<Pair> getTags()
Getter to get Tags Set
Returns:
getTagsMap
protected TwinCollection getTagsMap()
Getter for the tags
Returns:
getTagsVersion
public Integer getTagsVersion()
Getter for the tag version.
Returns:
Integer with the Tags Collection version.getVersion
public Integer getVersion()
Getter for the Twin version
Returns:
null.reportedPropertiesToString
public String reportedPropertiesToString()
String representation for this device containing reported properties
Returns:
setCapabilities
protected void setCapabilities(DeviceCapabilities capabilities)
Setter for capabilities
Parameters:
setConfigurations
protected void setConfigurations(Map<String,ConfigurationInfo> configurations)
Setter for the configuration properties
Parameters:
setConnectionState
protected void setConnectionState(String connectionState)
Set the connection state of the device
Parameters:
setDesiredProperties
public void setDesiredProperties(Set<Pair> desiredProperties)
Setter for the desired properties
Parameters:
Throws:
setDesiredProperties
protected void setDesiredProperties(TwinCollection desiredProperties)
Setter for the desired properties
Parameters:
setETag
public void setETag(String eTag)
Setter for ETag
Parameters:
Throws:
setModelId
public void setModelId(String modelId)
Parameters:
setReportedProperties
protected void setReportedProperties(TwinCollection reportedProperties)
Setter for the reported properties
Parameters:
setTags
public void setTags(Set<Pair> tags)
Setter for the tags
Parameters:
Throws:
setTags
protected void setTags(TwinCollection tag)
Setter for the tags
Parameters:
tagsToString
public String tagsToString()
String representation for this device containing tags
Returns:
toString
public String toString()
String representation for this device containing device id, tags, desired and reported properties
Overrides:
DeviceTwinDevice.toString()Returns: