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

349 строки
14 KiB
YAML
Исходник Постоянная ссылка Ответственный История

Этот файл содержит невидимые символы Юникода!

Этот файл содержит невидимые символы Юникода, которые могут быть отображены не так, как показано ниже. Если это намеренно, можете спокойно проигнорировать это предупреждение. Используйте кнопку Экранировать, чтобы показать скрытые символы.

### YamlMime:JavaType
constructors:
- fullName: com.microsoft.azure.sdk.iot.device.twin.Twin.Twin(TwinCollection desiredProperty, TwinCollection reportedProperty)
name: Twin(TwinCollection desiredProperty, TwinCollection reportedProperty)
nameWithType: Twin.Twin(TwinCollection desiredProperty, TwinCollection reportedProperty)
parameters:
- description: >-
<p>the <xref uid="com.microsoft.azure.sdk.iot.device.twin.TwinCollection" data-throw-if-not-resolved="false" data-raw-source="TwinCollection"></xref> with the desired properties. It can be<code>null 
</code> . </p>
name: desiredProperty
type: <xref href="com.microsoft.azure.sdk.iot.device.twin.TwinCollection?alt=com.microsoft.azure.sdk.iot.device.twin.TwinCollection&text=TwinCollection" data-throw-if-not-resolved="False"/>
- description: >-
<p>the <xref uid="com.microsoft.azure.sdk.iot.device.twin.TwinCollection" data-throw-if-not-resolved="false" data-raw-source="TwinCollection"></xref> with the reported properties. It can be<code>null 
</code> . </p>
name: reportedProperty
type: <xref href="com.microsoft.azure.sdk.iot.device.twin.TwinCollection?alt=com.microsoft.azure.sdk.iot.device.twin.TwinCollection&text=TwinCollection" data-throw-if-not-resolved="False"/>
summary: "<p>CONSTRUCTOR</p>\r\n<p>This constructor creates an instance of the Twin with the provided <xref uid=\"com.microsoft.azure.sdk.iot.device.twin.TwinCollection\" data-throw-if-not-resolved=\"false\" data-raw-source=\"TwinCollection\"></xref> tags and desired properties.</p>\r\n<p>When serialized, this class will looks like the following example: <pre><code>\"initialTwin\": {\r\n     \"tags\":{\r\n         \"SpeedUnity\":\"MPH\",\r\n         \"$version\":4\r\n     }\r\n     \"properties\":{\r\n         \"desired\":{\r\n             \"MaxSpeed\":{\r\n                 \"Value\":500,\r\n                 \"NewValue\":300\r\n             },\r\n             \"$version\":4\r\n         }\r\n     }\r\n }\r\n </code> \r\n }\r\n</pre></p>\r\n<p></p>"
syntax: public Twin(TwinCollection desiredProperty, TwinCollection reportedProperty)
uid: com.microsoft.azure.sdk.iot.device.twin.Twin.Twin(TwinCollection,TwinCollection)
inheritances:
- <xref href="java.lang.Object" data-throw-if-not-resolved="False"/>
methods:
- fullName: com.microsoft.azure.sdk.iot.device.twin.Twin.createFromDesiredPropertyJson(String json)
name: createFromDesiredPropertyJson(String json)
nameWithType: Twin.createFromDesiredPropertyJson(String json)
parameters:
- description: >-
<p>the<code>String 
</code> with the JSON received from the service. It cannot be<code>null 
</code> or empty. </p>
name: json
type: <xref href="String?alt=String&text=String" data-throw-if-not-resolved="False"/>
returns:
description: >-
<p>The new instance of the<code>Twin 
</code> . </p>
type: <xref href="com.microsoft.azure.sdk.iot.device.twin.Twin?alt=com.microsoft.azure.sdk.iot.device.twin.Twin&text=Twin" data-throw-if-not-resolved="False"/>
summary: >-
<p>Factory</p>
<p>Create a new instance of the Twin parsing the provided string as a JSON with only desired properties information.</p>
<p></p>
syntax: public static Twin createFromDesiredPropertyJson(String json)
uid: com.microsoft.azure.sdk.iot.device.twin.Twin.createFromDesiredPropertyJson(String)
- fullName: com.microsoft.azure.sdk.iot.device.twin.Twin.createFromPropertiesJson(String json)
name: createFromPropertiesJson(String json)
nameWithType: Twin.createFromPropertiesJson(String json)
parameters:
- description: >-
<p>the<code>String 
</code> with the JSON received from the service. It cannot be<code>null 
</code> or empty. </p>
name: json
type: <xref href="String?alt=String&text=String" data-throw-if-not-resolved="False"/>
returns:
description: >-
<p>The new instance of the<code>Twin 
</code> . </p>
type: <xref href="com.microsoft.azure.sdk.iot.device.twin.Twin?alt=com.microsoft.azure.sdk.iot.device.twin.Twin&text=Twin" data-throw-if-not-resolved="False"/>
summary: >-
<p>Factory</p>
<p>Create a new instance of the Twin parsing the provided string as a JSON with only desired properties information.</p>
<p></p>
syntax: public static Twin createFromPropertiesJson(String json)
uid: com.microsoft.azure.sdk.iot.device.twin.Twin.createFromPropertiesJson(String)
- fullName: com.microsoft.azure.sdk.iot.device.twin.Twin.createFromReportedPropertyJson(String json)
name: createFromReportedPropertyJson(String json)
nameWithType: Twin.createFromReportedPropertyJson(String json)
parameters:
- description: >-
<p>the<code>String 
</code> with the JSON received from the service. It cannot be<code>null 
</code> or empty. </p>
name: json
type: <xref href="String?alt=String&text=String" data-throw-if-not-resolved="False"/>
returns:
description: >-
<p>The new instance of the<code>Twin 
</code> . </p>
type: <xref href="com.microsoft.azure.sdk.iot.device.twin.Twin?alt=com.microsoft.azure.sdk.iot.device.twin.Twin&text=Twin" data-throw-if-not-resolved="False"/>
summary: >-
<p>Factory</p>
<p>Create a new instance of the Twin parsing the provided string as a JSON with only reported properties information.</p>
<p></p>
syntax: public static Twin createFromReportedPropertyJson(String json)
uid: com.microsoft.azure.sdk.iot.device.twin.Twin.createFromReportedPropertyJson(String)
- fullName: com.microsoft.azure.sdk.iot.device.twin.Twin.createFromTwinJson(String json)
name: createFromTwinJson(String json)
nameWithType: Twin.createFromTwinJson(String json)
parameters:
- description: >-
<p>the<code>String 
</code> with the JSON received from the service. It cannot be<code>null 
</code> or empty. </p>
name: json
type: <xref href="String?alt=String&text=String" data-throw-if-not-resolved="False"/>
returns:
description: >-
<p>The new instance of the<code>Twin 
</code> . </p>
type: <xref href="com.microsoft.azure.sdk.iot.device.twin.Twin?alt=com.microsoft.azure.sdk.iot.device.twin.Twin&text=Twin" data-throw-if-not-resolved="False"/>
summary: >-
<p>Factory</p>
<p>Create a new instance of the Twin parsing the provided string as a JSON with the full Twin information.</p>
<p></p>
syntax: public static Twin createFromTwinJson(String json)
uid: com.microsoft.azure.sdk.iot.device.twin.Twin.createFromTwinJson(String)
- fullName: com.microsoft.azure.sdk.iot.device.twin.Twin.getDesiredProperties()
name: getDesiredProperties()
nameWithType: Twin.getDesiredProperties()
returns:
description: >-
<p>The<code>TwinCollection 
</code> with the desired property content. It can be<code>null 
</code> . </p>
type: <xref href="com.microsoft.azure.sdk.iot.device.twin.TwinCollection?alt=com.microsoft.azure.sdk.iot.device.twin.TwinCollection&text=TwinCollection" data-throw-if-not-resolved="False"/>
summary: >-
<p>Getter for the desired property.</p>
<p></p>
syntax: public TwinCollection getDesiredProperties()
uid: com.microsoft.azure.sdk.iot.device.twin.Twin.getDesiredProperties()
- fullName: com.microsoft.azure.sdk.iot.device.twin.Twin.getReportedProperties()
name: getReportedProperties()
nameWithType: Twin.getReportedProperties()
returns:
description: >-
<p>The<code>TwinCollection 
</code> with the reported property content. It can be<code>null 
</code> . </p>
type: <xref href="com.microsoft.azure.sdk.iot.device.twin.TwinCollection?alt=com.microsoft.azure.sdk.iot.device.twin.TwinCollection&text=TwinCollection" data-throw-if-not-resolved="False"/>
summary: >-
<p>Getter for the reported property.</p>
<p></p>
syntax: public TwinCollection getReportedProperties()
uid: com.microsoft.azure.sdk.iot.device.twin.Twin.getReportedProperties()
- fullName: com.microsoft.azure.sdk.iot.device.twin.Twin.toJsonElement()
name: toJsonElement()
nameWithType: Twin.toJsonElement()
returns:
description: >-
<p>The<code>JsonElement 
</code> with the content of this class. </p>
type: <xref href="JsonElement?alt=JsonElement&text=JsonElement" data-throw-if-not-resolved="False"/>
summary: >-
<p>Serializer</p>
<p>Creates a<code>JsonElement 
</code> , which the content represents the information in this class and its subclasses in a JSON format.</p>
<p>This is useful if the caller will integrate this JSON with JSON from other classes to generate a consolidated JSON. </p>
<p></p>
syntax: public JsonElement toJsonElement()
uid: com.microsoft.azure.sdk.iot.device.twin.Twin.toJsonElement()
- fullName: com.microsoft.azure.sdk.iot.device.twin.Twin.toString()
name: toString()
nameWithType: Twin.toString()
returns:
description: >-
<p>The<code>String 
</code> with the pretty print JSON. </p>
type: <xref href="String?alt=String&text=String" data-throw-if-not-resolved="False"/>
summary: >-
<p>Creates a pretty print JSON with the content of this class and subclasses.</p>
<p></p>
syntax: public String toString()
uid: com.microsoft.azure.sdk.iot.device.twin.Twin.toString()
nameWithType: Twin
syntax: public class Twin
type: class
uid: com.microsoft.azure.sdk.iot.device.twin.Twin
fullName: com.microsoft.azure.sdk.iot.device.twin.Twin
name: Twin
package: com.microsoft.azure.sdk.iot.device.twin
summary: >-
<p>Representation of a single Twin.</p>
<p>The Twin can contain one <xref uid="com.microsoft.azure.sdk.iot.device.twin.TwinCollection" data-throw-if-not-resolved="false" data-raw-source="TwinCollection"></xref> of <b>Tags</b>, and one <xref uid="com.microsoft.azure.sdk.iot.device.twin.TwinCollection" data-throw-if-not-resolved="false" data-raw-source="TwinCollection"></xref> of <b>properties.desired</b>.</p>
<p>Each entity in the collections can contain a associated <xref uid="com.microsoft.azure.sdk.iot.device.twin.TwinMetadata" data-throw-if-not-resolved="false" data-raw-source="TwinMetadata"></xref>.</p>
<p>These metadata are provided by the Service and contains information about the last updated date time, and version.</p>
<p>For instance, the following is a valid Twin, represented as <code>initialTwin 
</code> in the rest API. <pre><code>{
    "initialTwin": {
        "tags":{
            "SpeedUnity":"MPH",
            "$metadata":{
                "$lastUpdated":"2017-09-21T02:07:44.238Z",
                "$lastUpdatedVersion":4,
                "SpeedUnity":{
                    "$lastUpdated":"2017-09-21T02:07:44.238Z",
                    "$lastUpdatedVersion":4
                }
            },
            "$version":4
        },
        "properties":{
            "desired": {
                "MaxSpeed":{
                    "Value":500,
                    "NewValue":300
                },
                "$metadata":{
                    "$lastUpdated":"2017-09-21T02:07:44.238Z",
                    "$lastUpdatedVersion":4,
                    "MaxSpeed":{
                        "$lastUpdated":"2017-09-21T02:07:44.238Z",
                        "$lastUpdatedVersion":4,
                        "Value":{
                            "$lastUpdated":"2017-09-21T02:07:44.238Z",
                            "$lastUpdatedVersion":4
                        },
                        "NewValue":{
                            "$lastUpdated":"2017-09-21T02:07:44.238Z",
                            "$lastUpdatedVersion":4
                        }
                    }
                },
                "$version":4
            },
            "reported": {
                "MaxSpeed":{
                    "Value":500,
                    "NewValue":300
                },
                "$metadata":{
                    "$lastUpdated":"2017-09-21T02:07:44.238Z",
                    "$lastUpdatedVersion":5,
                    "MaxSpeed":{
                        "$lastUpdated":"2017-09-21T02:07:44.238Z",
                        "$lastUpdatedVersion":4,
                        "Value":{
                            "$lastUpdated":"2017-09-21T02:07:44.238Z",
                            "$lastUpdatedVersion":5
                        },
                        "NewValue":{
                            "$lastUpdated":"2017-09-21T02:07:44.238Z",
                            "$lastUpdatedVersion":4
                        }
                    }
                },
                "$version":6
            }
        }
    }
}
</code></pre></p>
<p></p>
metadata: {}