BasicDigitalTwin Class
- java.
lang. Object - com.
azure. digitaltwins. core. BasicDigitalTwin
- com.
Implements
public final class BasicDigitalTwin
implements JsonSerializable<BasicDigitalTwin>
An optional, helper class for deserializing a digital twin. Only properties with non-null values are included.
Note that this class uses JsonSerializable<T> from azure-json. Because of this, this type will work with any implementation of azure-json but support for generic objects is limited to what JsonWriter supports in JsonWriter#writeUntyped(Object). In order to support custom objects, a custom serializer must be used.
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 a custom property to the digital twin contents. |
|
static
Basic |
fromJson(JsonReader jsonReader)
Reads an instance of Basic |
| 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. |
|
Json |
toJson(JsonWriter jsonWriter) |
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 a 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:
fromJson
public static BasicDigitalTwin fromJson(JsonReader jsonReader)
Reads an instance of BasicDigitalTwin from the JsonReader.
Parameters:
Returns:
Throws:
getContents
public Map<String,Object> 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:
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: