Twin Class
- java.
lang. Object - com.
microsoft. azure. sdk. iot. service. twin. Twin
- com.
public class Twin
Represent the twin on IoT hub. Implementing constructors and serialization functionality.
The object is a representation of a module twin if and only if the moduleId is set.
Constructor Summary
Constructor | Description |
---|---|
Twin() |
Constructor to create an instance for a device. |
Twin(String deviceId) |
Constructor to create instance for a device. |
Twin(String deviceId, String moduleId) |
Constructor to create an instance for a module. |
Method Summary
Modifier and Type | Method and Description |
---|---|
Twin | fromJson(String json) |
Twin |
getDesiredProperties()
Getter to get the desired properties setter. |
Twin |
getReportedProperties()
Getter to get reported properties setter. |
Twin |
getTags()
Getter for the twin tags. |
String |
toString()
String representation for this device containing device Id, tags, desired and reported properties. |
Constructor Details
Twin
public Twin()
Constructor to create an instance for a device.
Twin
public Twin(String deviceId)
Constructor to create instance for a device.
Parameters:
Throws:
This exception is thrown if the device Id isnull
</code> or empty </p>
Twin
public Twin(String deviceId, String moduleId)
Constructor to create an instance for a module.
Parameters:
Throws:
This exception is thrown if the device id isnull
</code> or empty. </p>
Method Details
fromJson
public static Twin fromJson(String json)
Parameters:
getDesiredProperties
public TwinCollection getDesiredProperties()
Getter to get the desired properties setter.
Returns:
getReportedProperties
public TwinCollection getReportedProperties()
Getter to get reported properties setter.
Returns:
getTags
public TwinCollection getTags()
Getter for the twin tags.
Returns:
toString
public String toString()
String representation for this device containing device Id, tags, desired and reported properties.
Returns:
Applies to
Azure SDK for Java
Feedback
https://aka.ms/ContentUserFeedback.
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see:Submit and view feedback for