Package com.azure.data.cosmos
Class SqlParameter
- java.lang.Object
-
- com.azure.data.cosmos.JsonSerializable
-
- com.azure.data.cosmos.SqlParameter
-
public final class SqlParameter extends JsonSerializable
Represents a SQL parameter in the SqlQuerySpec used for queries in the Azure Cosmos DB database service.
-
-
Constructor Summary
Constructors Constructor Description SqlParameter()
Initializes a new instance of the SqlParameter class.SqlParameter(String name, Object value)
Initializes a new instance of the SqlParameter class with the name and value of the parameter.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
name()
Gets the name of the parameter.SqlParameter
name(String name)
Sets the name of the parameter.<T> Object
value(Class<T> c)
Gets the value of the parameter.SqlParameter
value(Object value)
Sets the value of the parameter.-
Methods inherited from class com.azure.data.cosmos.JsonSerializable
get, getBoolean, getCollection, getDouble, getInt, getList, getLogger, getLong, getMap, getObject, getObjectByPath, getString, has, toJson, toJson, toObject, toString
-
-
-
-
Method Detail
-
name
public String name()
Gets the name of the parameter.- Returns:
- the name of the parameter.
-
name
public SqlParameter name(String name)
Sets the name of the parameter.- Parameters:
name
- the name of the parameter.- Returns:
- the SqlParameter.
-
value
public <T> Object value(Class<T> c)
Gets the value of the parameter.- Type Parameters:
T
- the type of the parameter- Parameters:
c
- the class of the parameter value.- Returns:
- the value of the parameter.
-
value
public SqlParameter value(Object value)
Sets the value of the parameter.- Parameters:
value
- the value of the parameter.- Returns:
- the SqlParameter.
-
-