### YamlMime:JavaType uid: "com.microsoft.azure.sdk.iot.deps.twin.TwinMetadata" fullName: "com.microsoft.azure.sdk.iot.deps.twin.TwinMetadata" name: "TwinMetadata" nameWithType: "TwinMetadata" summary: "Representation of a single Twin metadata for the ." inheritances: - "" inheritedClassMethods: - classRef: "" methodsRef: - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" syntax: "public class **TwinMetadata**" fields: - uid: "com.microsoft.azure.sdk.iot.deps.twin.TwinMetadata.LAST_UPDATE_TAG" fullName: "com.microsoft.azure.sdk.iot.deps.twin.TwinMetadata.LAST_UPDATE_TAG" name: "LAST_UPDATE_TAG" nameWithType: "TwinMetadata.LAST_UPDATE_TAG" modifiers: - "static" - "final" field: value: "$lastUpdated" type: "" syntax: "public static final String LAST_UPDATE_TAG" - uid: "com.microsoft.azure.sdk.iot.deps.twin.TwinMetadata.LAST_UPDATE_VERSION_TAG" fullName: "com.microsoft.azure.sdk.iot.deps.twin.TwinMetadata.LAST_UPDATE_VERSION_TAG" name: "LAST_UPDATE_VERSION_TAG" nameWithType: "TwinMetadata.LAST_UPDATE_VERSION_TAG" modifiers: - "static" - "final" field: value: "$lastUpdatedVersion" type: "" syntax: "public static final String LAST_UPDATE_VERSION_TAG" methods: - uid: "com.microsoft.azure.sdk.iot.deps.twin.TwinMetadata.getLastUpdated()" fullName: "com.microsoft.azure.sdk.iot.deps.twin.TwinMetadata.getLastUpdated()" name: "getLastUpdated()" nameWithType: "TwinMetadata.getLastUpdated()" summary: "Getter for the lastUpdated." syntax: "public Date getLastUpdated()" desc: "Getter for the lastUpdated." returns: description: "the Date with the stored lastUpdated. It can be null." type: "" - uid: "com.microsoft.azure.sdk.iot.deps.twin.TwinMetadata.getLastUpdatedVersion()" fullName: "com.microsoft.azure.sdk.iot.deps.twin.TwinMetadata.getLastUpdatedVersion()" name: "getLastUpdatedVersion()" nameWithType: "TwinMetadata.getLastUpdatedVersion()" summary: "Getter for the lastUpdatedVersion." syntax: "public Integer getLastUpdatedVersion()" desc: "Getter for the lastUpdatedVersion." returns: description: "the Integer with the stored lastUpdatedVersion. It can be null." type: "" - uid: "com.microsoft.azure.sdk.iot.deps.twin.TwinMetadata.toJsonElement()" fullName: "com.microsoft.azure.sdk.iot.deps.twin.TwinMetadata.toJsonElement()" name: "toJsonElement()" nameWithType: "TwinMetadata.toJsonElement()" summary: "Serializer" modifiers: - "protected" syntax: "protected JsonElement toJsonElement()" desc: "Serializer\n\nCreates a `JsonElement`, which the content represents the information in this class in a JSON format. This is useful if the caller will integrate this JSON with JSON from other classes to generate a consolidated JSON." returns: description: "The JsonElement with the content of this class." type: "" - uid: "com.microsoft.azure.sdk.iot.deps.twin.TwinMetadata.toString()" fullName: "com.microsoft.azure.sdk.iot.deps.twin.TwinMetadata.toString()" name: "toString()" nameWithType: "TwinMetadata.toString()" summary: "Creates a pretty print JSON with the content of this class and subclasses." overridden: "java.lang.Object.toString()" syntax: "public String toString()" desc: "Creates a pretty print JSON with the content of this class and subclasses." returns: description: "The String with the pretty print JSON." type: "" - uid: "com.microsoft.azure.sdk.iot.deps.twin.TwinMetadata.tryExtractFromMap(java.lang.Object)" fullName: "com.microsoft.azure.sdk.iot.deps.twin.TwinMetadata.tryExtractFromMap(Object metadata)" name: "tryExtractFromMap(Object metadata)" nameWithType: "TwinMetadata.tryExtractFromMap(Object metadata)" summary: "Metadata extractor" modifiers: - "protected" - "static" parameters: - description: "the Object that may contains the metadata." name: "metadata" type: "" syntax: "protected static TwinMetadata tryExtractFromMap(Object metadata)" desc: "Metadata extractor\n\nThis internal method will try to find $lastUpdated and $lastUpdatedVersion at the first level of the provided Map (Object), and create a new instance of the TwinMetadata with this information.\n\nOnce the provide Object can or cannot be a Map, and, if it is a Map, it can or cannot contains a valid metadata, this method contains the label **try**, which means that it can return a valid TwinMetadata or `null`.\n\nFor instance, for the follow Map, this method will create a TwinMetadata with `lastUpdated = 2015-09-21T02:07:44.238Z` and `lastUpdatedVersion = 3`\n\n```java\n\"$lastUpdated\":\"2015-09-21T02:07:44.238Z\",\n \"$lastUpdatedVersion\":3,\n \"Value\":{\n \"$lastUpdated\":\"2016-09-21T02:07:44.238Z\",\n \"$lastUpdatedVersion\":5\n },\n \"NewValue\":{\n \"$lastUpdated\":\"2017-09-21T02:07:44.238Z\",\n \"$lastUpdatedVersion\":5\n }\n```" returns: description: "A valid TwinMetadata instance it the provided metadata Object is a Map with\n data and version metadata, or null for the other cases." type: "" type: "class" desc: "Representation of a single Twin metadata for the .\n\nThe metadata is a set of pairs lastUpdated/lastUpdatedVersion for each property and sub-property in the Twin. It is optionally provided by the service and the clients can only ready it.\n\nThis class store the Date and Version for each entity in the .\n\nFor instance, the following is a valid TwinCollection with its metadata.\n\n```java\n\"$metadata\":{\n \"$lastUpdated\":\"2017-09-21T02:07:44.238Z\",\n \"$lastUpdatedVersion\":4,\n \"MaxSpeed\":{\n \"$lastUpdated\":\"2017-09-21T02:07:44.238Z\",\n \"$lastUpdatedVersion\":3,\n \"Value\":{\n \"$lastUpdated\":\"2017-09-21T02:07:44.238Z\",\n \"$lastUpdatedVersion\":5\n },\n \"NewValue\":{\n \"$lastUpdated\":\"2017-09-21T02:07:44.238Z\",\n \"$lastUpdatedVersion\":5\n }\n }\n }\n```" metadata: {} package: "com.microsoft.azure.sdk.iot.deps.twin" artifact: com.microsoft.azure.sdk.iot:iot-deps:0.12.0