共用方式為


SqlParameter Class

  • java.lang.Object
    • com.azure.cosmos.models.SqlParameter

public final class SqlParameter

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
T getValue(Class<T> classType)

Gets the value of the parameter.

boolean equals(Object o)
String getName()

Gets the name of the parameter.

int hashCode()
SqlParameter setName(String name)

Sets the name of the parameter.

SqlParameter setValue(Object value)

Sets the value of the parameter.

Methods inherited from java.lang.Object

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 T getValue(Class classType)

Gets the value of the parameter.

Parameters:

classType - the class of the parameter value.

Returns:

the value of the parameter.

equals

public boolean equals(Object o)

Overrides:

SqlParameter.equals(Object o)

Parameters:

o

getName

public String getName()

Gets the name of the parameter.

Returns:

the name of the parameter.

hashCode

public int hashCode()

Overrides:

SqlParameter.hashCode()

setName

public SqlParameter setName(String name)

Sets the name of the parameter.

Parameters:

name - the name of the parameter.

Returns:

the SqlParameter.

setValue

public SqlParameter setValue(Object value)

Sets the value of the parameter.

Parameters:

value - the value of the parameter.

Returns:

the SqlParameter.

Applies to