你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn

QuerySpecification Class

public class QuerySpecification
extends Serializable

Representation of a single Device Provisioning Service query specification with a JSON serializer.

Constructor Summary

Constructor Description
QuerySpecification(String query)

CONSTRUCTOR

Method Summary

Modifier and Type Method and Description
java.lang.String getQuery()

Getter for the query.

com.google.gson.JsonElement toJsonElement()

Serializer

Methods inherited from Serializable

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.wait java.lang.Object.wait java.lang.Object.wait

Constructor Details

QuerySpecification

public QuerySpecification(String query)

CONSTRUCTOR

This constructor creates an instance of the query specification.

The query must follow the provisioning service Query Language

When serialized, this class will look like the following example:

{
     "query":"SELECT * FROM enrollments",
 }

Parameters:

query - the String with the query. It cannot be null, empty or a invalid query.

Method Details

getQuery

public String getQuery()

Getter for the query.

Returns:

The String with the information stored in the query. It cannot be null.

toJsonElement

public JsonElement toJsonElement()

Serializer

Creates 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 jsons from other classes to generate a consolidated JSON.

Overrides:

QuerySpecification.toJsonElement()

Returns:

The JsonElement with the content of this class.

Applies to