Package com.azure.digitaltwins.core
Class BasicDigitalTwin
java.lang.Object
com.azure.digitaltwins.core.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
-
Method Summary
Modifier and TypeMethodDescriptionaddToContents
(String key, Object value) Adds an additional custom property to the digital twin contents.Gets the additional custom contents of the digital twin.getETag()
Gets a string representing a weak ETag for the entity that this request performs an operation against, as per RFC7232.getId()
Gets the unique Id of the digital twin in a digital twins instance.Gets the date and time when the twin was last updated.Gets the information about the model a digital twin conforms to.Sets a string representing a weak ETag for the entity that this request performs an operation against, as per RFC7232.setMetadata
(BasicDigitalTwinMetadata metadata) Sets the information about the model a digital twin conforms to.
-
Constructor Details
-
BasicDigitalTwin
Construct a basic digital twin.- Parameters:
digitalTwinId
- The Id of the digital twin. The Id is unique within the service and case sensitive.
-
-
Method Details
-
getId
Gets the unique Id of the digital twin in a digital twins instance. This field is present on every digital twin.- Returns:
- The unique Id of the digital twin in a digital twins instance. This field is present on every digital twin.
-
getETag
Gets a string representing a weak ETag for the entity that this request performs an operation against, as per RFC7232.- Returns:
- A string representing a weak ETag for the entity that this request performs an operation against, as per RFC7232.
-
setETag
Sets a string representing a weak ETag for the entity that this request performs an operation against, as per RFC7232.- Parameters:
etag
- A string representing a weak ETag for the entity that this request performs an operation against, as per RFC7232.- Returns:
- The BasicDigitalTwin object itself.
-
getLastUpdatedOn
Gets the date and time when the twin was last updated.- Returns:
- The date and time the twin was last updated.
-
getMetadata
Gets the information about the model a digital twin conforms to. This field is present on every digital twin.- Returns:
- The information about the model a digital twin conforms to. This field is present on every digital twin.
-
setMetadata
Sets the information about the model a digital twin conforms to. This field is present on every digital twin.- Parameters:
metadata
- The information about the model a digital twin conforms to. This field is present on every digital twin.- Returns:
- The BasicDigitalTwin object itself.
-
getContents
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:
- The additional 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.
-
addToContents
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:
key
- The key of the additional property to be added to the digital twin.value
- The value of the additional property to be added to the digital twin.- Returns:
- The BasicDigitalTwin object itself.
-