BasicDigitalTwin Class
- java.
lang. Object - com.
azure. digitaltwins. core. BasicDigitalTwin
- com.
public final class BasicDigitalTwin
An optional, helper class for deserializing a digital twin. Only properties with non-null values are included.
Note that this class uses JsonProperty from the Jackson serialization library. Because of this, this type will only work if the default json serializer is used by the digital twins client or if the custom json serializer uses Jackson as well. In order to use a different json library, a new BasicDigitalTwin class must be constructed and have its json properties tagged by the annotation used by that json library.
Constructor Summary
Constructor | Description |
---|---|
BasicDigitalTwin(String digitalTwinId) |
Construct a basic digital twin. |
Method Summary
Modifier and Type | Method and Description |
---|---|
Basic |
addToContents(String key, Object value)
Adds an additional custom property to the digital twin contents. |
Map<String,Object> |
getContents()
Gets the additional custom contents of the digital twin. |
String |
getETag()
Gets a string representing a weak ETag for the entity that this request performs an operation against, as per RFC7232. |
String |
getId()
Gets the unique Id of the digital twin in a digital twins instance. |
Offset |
getLastUpdatedOn()
Gets the date and time when the twin was last updated. |
Basic |
getMetadata()
Gets the information about the model a digital twin conforms to. |
Basic |
setETag(String etag)
Sets a string representing a weak ETag for the entity that this request performs an operation against, as per RFC7232. |
Basic |
setMetadata(BasicDigitalTwinMetadata metadata)
Sets the information about the model a digital twin conforms to. |
Methods inherited from java.lang.Object
Constructor Details
BasicDigitalTwin
public BasicDigitalTwin(String digitalTwinId)
Construct a basic digital twin.
Parameters:
Method Details
addToContents
public BasicDigitalTwin addToContents(String key, Object value)
Adds an additional custom property to the digital twin contents. This field will contain any contents of the digital twin that are not already defined by the other strong types of this class.
Parameters:
Returns:
getContents
public Map
Gets the additional custom contents of the digital twin. This field will contain any contents of the digital twin that are not already defined by the other strong types of this class.
Returns:
getETag
public String getETag()
Gets a string representing a weak ETag for the entity that this request performs an operation against, as per RFC7232.
Returns:
getId
public String getId()
Gets the unique Id of the digital twin in a digital twins instance. This field is present on every digital twin.
Returns:
getLastUpdatedOn
public OffsetDateTime getLastUpdatedOn()
Gets the date and time when the twin was last updated.
Returns:
getMetadata
public BasicDigitalTwinMetadata getMetadata()
Gets the information about the model a digital twin conforms to. This field is present on every digital twin.
Returns:
setETag
public BasicDigitalTwin setETag(String etag)
Sets a string representing a weak ETag for the entity that this request performs an operation against, as per RFC7232.
Parameters:
Returns:
setMetadata
public BasicDigitalTwin setMetadata(BasicDigitalTwinMetadata metadata)
Sets the information about the model a digital twin conforms to. This field is present on every digital twin.
Parameters:
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