QuerySpecification Class
- java.
lang. Object - com.
microsoft. azure. sdk. iot. provisioning. service. configs. Serializable - com.
microsoft. azure. sdk. iot. provisioning. service. configs. QuerySpecification
- com.
- com.
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
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:
String
with the query. It cannot be null
, empty or a invalid query.
Method Details
getQuery
public String getQuery()
Getter for the query.
Returns:
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:
JsonElement
with the content of this class.Applies to
Azure SDK for Java