BasicDigitalTwin Class

  • java.lang.Object
    • com.microsoft.azure.sdk.iot.service.digitaltwin.serialization.BasicDigitalTwin

public class BasicDigitalTwin

An optional, helper class for deserializing a digital twin. Only properties with non-null values are included.

Method Summary

Modifier and Type Method and Description
BasicDigitalTwin addCustomProperty(String key, Object value)

Adds an additional property to the digital twin. This field will contain any properties of the digital twin that are not already defined by the other strong types of this class.

Map<String, Object> getCustomProperties()

Gets the additional properties of the digital twin. This field will contain any properties of the digital twin that are not already defined by the other strong types of this class.

String getId()

Gets the unique Id of the digital twin in a digital twins instance. This field is present on every digital twin.

DigitalTwinMetadata getMetadata()

Gets the information about the model a digital twin conforms to. This field is present on every digital twin.

BasicDigitalTwin setId(String id)

Sets the unique Id of the digital twin in a digital twins instance. This field is present on every digital twin.

BasicDigitalTwin setMetadata(DigitalTwinMetadata metadata)

Sets the information about the model a digital twin conforms to. This field is present on every digital twin.

Method Details

addCustomProperty

public BasicDigitalTwin addCustomProperty(String key, Object value)

Adds an additional property to the digital twin. This field will contain any properties 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.

getCustomProperties

public Map getCustomProperties()

Gets the additional properties of the digital twin. This field will contain any properties of the digital twin that are not already defined by the other strong types of this class.

Returns:

The additional properties of the digital twin. This field will contain any properties of the digital twin that are not already defined by the other strong types of this class.

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:

The unique Id of the digital twin in a digital twins instance. This field is present on every digital twin.

getMetadata

public DigitalTwinMetadata 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.

setId

public BasicDigitalTwin setId(String id)

Sets the unique Id of the digital twin in a digital twins instance. This field is present on every digital twin.

Parameters:

id - The unique Id of the digital twin in a digital twins instance. This field is present on every digital twin.

Returns:

The BasicDigitalTwin object itself.

setMetadata

public BasicDigitalTwin setMetadata(DigitalTwinMetadata metadata)

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.

Applies to