Partilhar via


TwinMetadata Class

  • java.lang.Object
    • com.microsoft.azure.sdk.iot.provisioning.service.configs.TwinMetadata

public class TwinMetadata

Representation of a single Twin metadata for the Device Provisioning Service.

The metadata is a set of pairs lastUpdated/lastUpdatedVersion for each property and sub-property in the Twin. It is optionally provided by the provisioning service and the clients can only ready it.

This class store the Date and Version for each entity in the TwinCollection.

For instance, the following is a valid TwinCollection with its metadata.

"$metadata":{
      "$lastUpdated":"2017-09-21T02:07:44.238Z",
      "$lastUpdatedVersion":4,
      "MaxSpeed":{
          "$lastUpdated":"2017-09-21T02:07:44.238Z",
          "$lastUpdatedVersion":3,
          "Value":{
              "$lastUpdated":"2017-09-21T02:07:44.238Z",
              "$lastUpdatedVersion":5
          },
          "NewValue":{
              "$lastUpdated":"2017-09-21T02:07:44.238Z",
              "$lastUpdatedVersion":5
          }
      }
  }

Method Summary

Modifier and Type Method and Description
java.util.Date getLastUpdated()

Getter for the lastUpdated.

java.lang.Integer getLastUpdatedVersion()

Getter for the lastUpdatedVersion.

Methods inherited from java.lang.Object

java.lang.Object.clone java.lang.Object.equals java.lang.Object.finalize java.lang.Object.getClass java.lang.Object.hashCode java.lang.Object.notify java.lang.Object.notifyAll java.lang.Object.toString java.lang.Object.wait java.lang.Object.wait java.lang.Object.wait

Method Details

getLastUpdated

public Date getLastUpdated()

Getter for the lastUpdated.

Returns:

the Date with the stored lastUpdated. It can be null.

getLastUpdatedVersion

public Integer getLastUpdatedVersion()

Getter for the lastUpdatedVersion.

Returns:

the Integer with the stored lastUpdatedVersion. It can be null.

Applies to