SqlParameter Class

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

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

Modifier and Type Method and Description
java.lang.Object getValue(Class<T> c)

Gets the value of the parameter.

java.lang.String getName()

Gets the name of the parameter.

void setName(String name)

Sets the name of the parameter.

void setValue(Object value)

Sets the value of the parameter.

Methods inherited from JsonSerializable

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

SqlParameter

public SqlParameter()

Initializes a new instance of the SqlParameter class.

SqlParameter

public SqlParameter(String name, Object value)

Initializes a new instance of the SqlParameter class with the name and value of the parameter.

Parameters:

name - the name of the parameter.
value - the value of the parameter.

Method Details

getValue

public Object getValue(Class c)

Gets the value of the parameter.

Parameters:

c - the class of the parameter value.

Returns:

the value of the parameter.

getName

public String getName()

Gets the name of the parameter.

Returns:

the name of the parameter.

setName

public void setName(String name)

Sets the name of the parameter.

Parameters:

name - the name of the parameter.

setValue

public void setValue(Object value)

Sets the value of the parameter.

Parameters:

value - the value of the parameter.

Applies to