QuerySpecification Class

  • java.lang.Object
    • java.io.Serializable
      • Serializable
        • com.microsoft.azure.sdk.iot.provisioning.service.configs.QuerySpecification

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

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",

}

</code></pre></p>

Method Summary

Modifier and Type Method and Description
JsonElement toJsonElement()

Serializer

Creates aJsonElement 

</code> , which the content represents the information in this class and its subclasses in a JSON format.</p>

This is useful if the caller will integrate this JSON with jsons from other classes to generate a consolidated JSON.

Inherited Members

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",

}

</code></pre></p>

Parameters:

query -

theString 

</code> with the query. It cannot be<code>null 

</code> , empty or a invalid query. </p>

Throws:

IllegalArgumentException - If the provided query is not a valid query.

Method Details

toJsonElement

public JsonElement toJsonElement()

Serializer

Creates aJsonElement 

</code> , which the content represents the information in this class and its subclasses in a JSON format.</p>

This is useful if the caller will integrate this JSON with jsons from other classes to generate a consolidated JSON.

Returns:

TheJsonElement 

</code> with the content of this class. </p>

Applies to