azure-docs-sdk-java/docs-ref-autogen/com.microsoft.azure.sdk.iot...

213 строки
19 KiB
YAML

### YamlMime:JavaType
uid: "com.microsoft.azure.sdk.iot.deps.twin.TwinState"
fullName: "com.microsoft.azure.sdk.iot.deps.twin.TwinState"
name: "TwinState"
nameWithType: "TwinState"
summary: "Representation of a single Twin."
inheritances:
- "<xref href=\"java.lang.Object?displayProperty=fullName\" data-throw-if-not-resolved=\"False\" />"
- "<xref href=\"com.microsoft.azure.sdk.iot.deps.twin.RegisterManager?displayProperty=fullName\" data-throw-if-not-resolved=\"False\" />"
inheritedMembers:
- "com.microsoft.azure.sdk.iot.deps.twin.RegisterManager.getCapabilities()"
- "com.microsoft.azure.sdk.iot.deps.twin.RegisterManager.getDeviceId()"
- "com.microsoft.azure.sdk.iot.deps.twin.RegisterManager.getETag()"
- "com.microsoft.azure.sdk.iot.deps.twin.RegisterManager.getModelId()"
- "com.microsoft.azure.sdk.iot.deps.twin.RegisterManager.getModuleId()"
- "com.microsoft.azure.sdk.iot.deps.twin.RegisterManager.getVersion()"
- "com.microsoft.azure.sdk.iot.deps.twin.RegisterManager.setCapabilities(com.microsoft.azure.sdk.iot.deps.twin.DeviceCapabilities)"
- "com.microsoft.azure.sdk.iot.deps.twin.RegisterManager.setDeviceId(java.lang.String)"
- "com.microsoft.azure.sdk.iot.deps.twin.RegisterManager.setETag(java.lang.String)"
- "com.microsoft.azure.sdk.iot.deps.twin.RegisterManager.setModelId(java.lang.String)"
- "com.microsoft.azure.sdk.iot.deps.twin.RegisterManager.setModuleId(java.lang.String)"
- "java.lang.Object.clone()"
- "java.lang.Object.equals(java.lang.Object)"
- "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(long)"
- "java.lang.Object.wait(long,int)"
syntax: "public class TwinState extends RegisterManager"
constructors:
- uid: "com.microsoft.azure.sdk.iot.deps.twin.TwinState.TwinState(com.microsoft.azure.sdk.iot.deps.twin.TwinCollection,com.microsoft.azure.sdk.iot.deps.twin.TwinCollection,com.microsoft.azure.sdk.iot.deps.twin.TwinCollection)"
fullName: "com.microsoft.azure.sdk.iot.deps.twin.TwinState.TwinState(TwinCollection tags, TwinCollection desiredProperty, TwinCollection reportedProperty)"
name: "TwinState(TwinCollection tags, TwinCollection desiredProperty, TwinCollection reportedProperty)"
nameWithType: "TwinState.TwinState(TwinCollection tags, TwinCollection desiredProperty, TwinCollection reportedProperty)"
summary: "CONSTRUCTOR"
parameters:
- description: "the <xref uid=\"com.microsoft.azure.sdk.iot.deps.twin.TwinCollection\" data-throw-if-not-resolved=\"false\" data-raw-source=\"TwinCollection\"></xref> with the initial tags state. It can be <code>null</code>."
name: "tags"
type: "<xref href=\"com.microsoft.azure.sdk.iot.deps.twin.TwinCollection?alt=com.microsoft.azure.sdk.iot.deps.twin.TwinCollection&text=TwinCollection\" data-throw-if-not-resolved=\"False\" />"
- description: "the <xref uid=\"com.microsoft.azure.sdk.iot.deps.twin.TwinCollection\" data-throw-if-not-resolved=\"false\" data-raw-source=\"TwinCollection\"></xref> with the desired properties. It can be <code>null</code>."
name: "desiredProperty"
type: "<xref href=\"com.microsoft.azure.sdk.iot.deps.twin.TwinCollection?alt=com.microsoft.azure.sdk.iot.deps.twin.TwinCollection&text=TwinCollection\" data-throw-if-not-resolved=\"False\" />"
- description: "the <xref uid=\"com.microsoft.azure.sdk.iot.deps.twin.TwinCollection\" data-throw-if-not-resolved=\"false\" data-raw-source=\"TwinCollection\"></xref> with the reported properties. It can be <code>null</code>."
name: "reportedProperty"
type: "<xref href=\"com.microsoft.azure.sdk.iot.deps.twin.TwinCollection?alt=com.microsoft.azure.sdk.iot.deps.twin.TwinCollection&text=TwinCollection\" data-throw-if-not-resolved=\"False\" />"
syntax: "public TwinState(TwinCollection tags, TwinCollection desiredProperty, TwinCollection reportedProperty)"
desc: "CONSTRUCTOR\n\nThis constructor creates an instance of the TwinState with the provided <xref uid=\"com.microsoft.azure.sdk.iot.deps.twin.TwinCollection\" data-throw-if-not-resolved=\"false\" data-raw-source=\"TwinCollection\"></xref> tags and desired properties.\n\nWhen serialized, this class will looks like the following example:\n\n```java\n\"initialTwin\": {\n \"tags\":{\n \"SpeedUnity\":\"MPH\",\n \"$version\":4\n }\n \"properties\":{\n \"desired\":{\n \"MaxSpeed\":{\n \"Value\":500,\n \"NewValue\":300\n },\n \"$version\":4\n }\n }\n }\n \n }\n```"
methods:
- uid: "com.microsoft.azure.sdk.iot.deps.twin.TwinState.createFromDesiredPropertyJson(java.lang.String)"
fullName: "com.microsoft.azure.sdk.iot.deps.twin.TwinState.createFromDesiredPropertyJson(String json)"
name: "createFromDesiredPropertyJson(String json)"
nameWithType: "TwinState.createFromDesiredPropertyJson(String json)"
summary: "Factory"
modifiers:
- "static"
parameters:
- description: "the <code>String</code> with the JSON received from the service. It cannot be <code>null</code> or empty."
name: "json"
type: "<xref href=\"java.lang.String?alt=java.lang.String&text=String\" data-throw-if-not-resolved=\"False\" />"
syntax: "public static TwinState createFromDesiredPropertyJson(String json)"
desc: "Factory\n\nCreate a new instance of the TwinState parsing the provided string as a JSON with only desired properties information."
returns:
description: "The new instance of the <code>TwinState</code>."
type: "<xref href=\"com.microsoft.azure.sdk.iot.deps.twin.TwinState?alt=com.microsoft.azure.sdk.iot.deps.twin.TwinState&text=TwinState\" data-throw-if-not-resolved=\"False\" />"
- uid: "com.microsoft.azure.sdk.iot.deps.twin.TwinState.createFromPropertiesJson(java.lang.String)"
fullName: "com.microsoft.azure.sdk.iot.deps.twin.TwinState.createFromPropertiesJson(String json)"
name: "createFromPropertiesJson(String json)"
nameWithType: "TwinState.createFromPropertiesJson(String json)"
summary: "Factory"
modifiers:
- "static"
parameters:
- description: "the <code>String</code> with the JSON received from the service. It cannot be <code>null</code> or empty."
name: "json"
type: "<xref href=\"java.lang.String?alt=java.lang.String&text=String\" data-throw-if-not-resolved=\"False\" />"
syntax: "public static TwinState createFromPropertiesJson(String json)"
desc: "Factory\n\nCreate a new instance of the TwinState parsing the provided string as a JSON with only desired properties information."
returns:
description: "The new instance of the <code>TwinState</code>."
type: "<xref href=\"com.microsoft.azure.sdk.iot.deps.twin.TwinState?alt=com.microsoft.azure.sdk.iot.deps.twin.TwinState&text=TwinState\" data-throw-if-not-resolved=\"False\" />"
- uid: "com.microsoft.azure.sdk.iot.deps.twin.TwinState.createFromReportedPropertyJson(java.lang.String)"
fullName: "com.microsoft.azure.sdk.iot.deps.twin.TwinState.createFromReportedPropertyJson(String json)"
name: "createFromReportedPropertyJson(String json)"
nameWithType: "TwinState.createFromReportedPropertyJson(String json)"
summary: "Factory"
modifiers:
- "static"
parameters:
- description: "the <code>String</code> with the JSON received from the service. It cannot be <code>null</code> or empty."
name: "json"
type: "<xref href=\"java.lang.String?alt=java.lang.String&text=String\" data-throw-if-not-resolved=\"False\" />"
syntax: "public static TwinState createFromReportedPropertyJson(String json)"
desc: "Factory\n\nCreate a new instance of the TwinState parsing the provided string as a JSON with only reported properties information."
returns:
description: "The new instance of the <code>TwinState</code>."
type: "<xref href=\"com.microsoft.azure.sdk.iot.deps.twin.TwinState?alt=com.microsoft.azure.sdk.iot.deps.twin.TwinState&text=TwinState\" data-throw-if-not-resolved=\"False\" />"
- uid: "com.microsoft.azure.sdk.iot.deps.twin.TwinState.createFromTwinJson(java.lang.String)"
fullName: "com.microsoft.azure.sdk.iot.deps.twin.TwinState.createFromTwinJson(String json)"
name: "createFromTwinJson(String json)"
nameWithType: "TwinState.createFromTwinJson(String json)"
summary: "Factory"
modifiers:
- "static"
parameters:
- description: "the <code>String</code> with the JSON received from the service. It cannot be <code>null</code> or empty."
name: "json"
type: "<xref href=\"java.lang.String?alt=java.lang.String&text=String\" data-throw-if-not-resolved=\"False\" />"
syntax: "public static TwinState createFromTwinJson(String json)"
desc: "Factory\n\nCreate a new instance of the TwinState parsing the provided string as a JSON with the full Twin information."
returns:
description: "The new instance of the <code>TwinState</code>."
type: "<xref href=\"com.microsoft.azure.sdk.iot.deps.twin.TwinState?alt=com.microsoft.azure.sdk.iot.deps.twin.TwinState&text=TwinState\" data-throw-if-not-resolved=\"False\" />"
- uid: "com.microsoft.azure.sdk.iot.deps.twin.TwinState.getConfigurations()"
fullName: "com.microsoft.azure.sdk.iot.deps.twin.TwinState.getConfigurations()"
name: "getConfigurations()"
nameWithType: "TwinState.getConfigurations()"
summary: "Getter for the configurations"
syntax: "public Map<String,ConfigurationInfo> getConfigurations()"
desc: "Getter for the configurations"
returns:
description: "The configurations. It can be <code>null</code>."
type: "<xref href=\"java.util.Map?alt=java.util.Map&text=Map\" data-throw-if-not-resolved=\"False\" />&lt;<xref href=\"java.lang.String?alt=java.lang.String&text=String\" data-throw-if-not-resolved=\"False\" />,<xref href=\"com.microsoft.azure.sdk.iot.deps.twin.ConfigurationInfo?alt=com.microsoft.azure.sdk.iot.deps.twin.ConfigurationInfo&text=ConfigurationInfo\" data-throw-if-not-resolved=\"False\" />&gt;"
- uid: "com.microsoft.azure.sdk.iot.deps.twin.TwinState.getConnectionState()"
fullName: "com.microsoft.azure.sdk.iot.deps.twin.TwinState.getConnectionState()"
name: "getConnectionState()"
nameWithType: "TwinState.getConnectionState()"
summary: "Get the connection state"
syntax: "public String getConnectionState()"
desc: "Get the connection state"
returns:
description: "the connection state"
type: "<xref href=\"java.lang.String?alt=java.lang.String&text=String\" data-throw-if-not-resolved=\"False\" />"
- uid: "com.microsoft.azure.sdk.iot.deps.twin.TwinState.getDesiredProperty()"
fullName: "com.microsoft.azure.sdk.iot.deps.twin.TwinState.getDesiredProperty()"
name: "getDesiredProperty()"
nameWithType: "TwinState.getDesiredProperty()"
summary: "Getter for the desired property."
syntax: "public TwinCollection getDesiredProperty()"
desc: "Getter for the desired property."
returns:
description: "The <code>TwinCollection</code> with the desired property content. It can be <code>null</code>."
type: "<xref href=\"com.microsoft.azure.sdk.iot.deps.twin.TwinCollection?alt=com.microsoft.azure.sdk.iot.deps.twin.TwinCollection&text=TwinCollection\" data-throw-if-not-resolved=\"False\" />"
- uid: "com.microsoft.azure.sdk.iot.deps.twin.TwinState.getDeviceScope()"
fullName: "com.microsoft.azure.sdk.iot.deps.twin.TwinState.getDeviceScope()"
name: "getDeviceScope()"
nameWithType: "TwinState.getDeviceScope()"
summary: "Gets the device scope."
syntax: "public String getDeviceScope()"
desc: "Gets the device scope."
returns:
description: "The device scope."
type: "<xref href=\"java.lang.String?alt=java.lang.String&text=String\" data-throw-if-not-resolved=\"False\" />"
- uid: "com.microsoft.azure.sdk.iot.deps.twin.TwinState.getParentScopes()"
fullName: "com.microsoft.azure.sdk.iot.deps.twin.TwinState.getParentScopes()"
name: "getParentScopes()"
nameWithType: "TwinState.getParentScopes()"
summary: "Gets the parent scopes."
syntax: "public List<String> getParentScopes()"
desc: "Gets the parent scopes."
returns:
description: "The parent scopes."
type: "<xref href=\"java.util.List?alt=java.util.List&text=List\" data-throw-if-not-resolved=\"False\" />&lt;<xref href=\"java.lang.String?alt=java.lang.String&text=String\" data-throw-if-not-resolved=\"False\" />&gt;"
- uid: "com.microsoft.azure.sdk.iot.deps.twin.TwinState.getReportedProperty()"
fullName: "com.microsoft.azure.sdk.iot.deps.twin.TwinState.getReportedProperty()"
name: "getReportedProperty()"
nameWithType: "TwinState.getReportedProperty()"
summary: "Getter for the reported property."
syntax: "public TwinCollection getReportedProperty()"
desc: "Getter for the reported property."
returns:
description: "The <code>TwinCollection</code> with the reported property content. It can be <code>null</code>."
type: "<xref href=\"com.microsoft.azure.sdk.iot.deps.twin.TwinCollection?alt=com.microsoft.azure.sdk.iot.deps.twin.TwinCollection&text=TwinCollection\" data-throw-if-not-resolved=\"False\" />"
- uid: "com.microsoft.azure.sdk.iot.deps.twin.TwinState.getTags()"
fullName: "com.microsoft.azure.sdk.iot.deps.twin.TwinState.getTags()"
name: "getTags()"
nameWithType: "TwinState.getTags()"
summary: "Getter for the tags."
syntax: "public TwinCollection getTags()"
desc: "Getter for the tags."
returns:
description: "The <code>TwinCollection</code> with the tags content. It can be <code>null</code>."
type: "<xref href=\"com.microsoft.azure.sdk.iot.deps.twin.TwinCollection?alt=com.microsoft.azure.sdk.iot.deps.twin.TwinCollection&text=TwinCollection\" data-throw-if-not-resolved=\"False\" />"
- uid: "com.microsoft.azure.sdk.iot.deps.twin.TwinState.toJsonElement()"
fullName: "com.microsoft.azure.sdk.iot.deps.twin.TwinState.toJsonElement()"
name: "toJsonElement()"
nameWithType: "TwinState.toJsonElement()"
summary: "Serializer"
syntax: "public JsonElement toJsonElement()"
desc: "Serializer\n\nCreates a `JsonElement`, which the content represents the information in this class and its subclasses 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 <code>JsonElement</code> with the content of this class."
type: "<xref href=\"com.google.gson.JsonElement?alt=com.google.gson.JsonElement&text=JsonElement\" data-throw-if-not-resolved=\"False\" />"
- uid: "com.microsoft.azure.sdk.iot.deps.twin.TwinState.toString()"
fullName: "com.microsoft.azure.sdk.iot.deps.twin.TwinState.toString()"
name: "toString()"
nameWithType: "TwinState.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 <code>String</code> with the pretty print JSON."
type: "<xref href=\"java.lang.String?alt=java.lang.String&text=String\" data-throw-if-not-resolved=\"False\" />"
type: "class"
desc: "Representation of a single Twin.\n\nThe TwinState can contain one <xref uid=\"com.microsoft.azure.sdk.iot.deps.twin.TwinCollection\" data-throw-if-not-resolved=\"false\" data-raw-source=\"TwinCollection\"></xref> of **Tags**, and one <xref uid=\"com.microsoft.azure.sdk.iot.deps.twin.TwinCollection\" data-throw-if-not-resolved=\"false\" data-raw-source=\"TwinCollection\"></xref> of **properties.desired**.\n\nEach entity in the collections can contain a associated <xref uid=\"com.microsoft.azure.sdk.iot.deps.twin.TwinMetadata\" data-throw-if-not-resolved=\"false\" data-raw-source=\"TwinMetadata\"></xref>.\n\nThese metadata are provided by the Service and contains information about the last updated date time, and version.\n\nFor instance, the following is a valid TwinState, represented as `initialTwin` in the rest API.\n\n```java\n{\n \"initialTwin\": {\n \"tags\":{\n \"SpeedUnity\":\"MPH\",\n \"$metadata\":{\n \"$lastUpdated\":\"2017-09-21T02:07:44.238Z\",\n \"$lastUpdatedVersion\":4,\n \"SpeedUnity\":{\n \"$lastUpdated\":\"2017-09-21T02:07:44.238Z\",\n \"$lastUpdatedVersion\":4\n }\n },\n \"$version\":4\n },\n \"properties\":{\n \"desired\": {\n \"MaxSpeed\":{\n \"Value\":500,\n \"NewValue\":300\n },\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\":4,\n \"Value\":{\n \"$lastUpdated\":\"2017-09-21T02:07:44.238Z\",\n \"$lastUpdatedVersion\":4\n },\n \"NewValue\":{\n \"$lastUpdated\":\"2017-09-21T02:07:44.238Z\",\n \"$lastUpdatedVersion\":4\n }\n }\n },\n \"$version\":4\n },\n \"reported\": {\n \"MaxSpeed\":{\n \"Value\":500,\n \"NewValue\":300\n },\n \"$metadata\":{\n \"$lastUpdated\":\"2017-09-21T02:07:44.238Z\",\n \"$lastUpdatedVersion\":5,\n \"MaxSpeed\":{\n \"$lastUpdated\":\"2017-09-21T02:07:44.238Z\",\n \"$lastUpdatedVersion\":4,\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\":4\n }\n }\n },\n \"$version\":6\n }\n }\n }\n }\n```"
metadata: {}
package: "com.microsoft.azure.sdk.iot.deps.twin"
artifact: com.microsoft.azure.sdk.iot:iot-deps:0.12.0