public abstract class QueryParameterValue extends Object implements Serializable
A static factory method is provided for each of the possible types (e.g. int64(Long)
for StandardSQLTypeName.INT64). Alternatively, an instance can be constructed by calling of(Object, Class)
with the value and a Class object, which will use these mappings:
No other types are supported through that entry point. The other types can be created by
calling of(Object, StandardSQLTypeName)
with the value and a particular
StandardSQLTypeName enum value.
Struct parameters are currently not supported.
Modifier and Type | Class and Description |
---|---|
static class |
QueryParameterValue.Builder |
Modifier and Type | Method and Description |
---|---|
static <T> QueryParameterValue |
array(T[] array,
Class<T> clazz)
Creates a
QueryParameterValue object with a type of ARRAY, and an array element type
based on the given class. |
static <T> QueryParameterValue |
array(T[] array,
StandardSQLTypeName type)
Creates a
QueryParameterValue object with a type of ARRAY the given array element type. |
static QueryParameterValue |
bool(Boolean value)
Creates a
QueryParameterValue object with a type of BOOL. |
static QueryParameterValue |
bytes(byte[] value)
Creates a
QueryParameterValue object with a type of BYTES. |
static QueryParameterValue |
date(String value)
Creates a
QueryParameterValue object with a type of DATE. |
static QueryParameterValue |
dateTime(String value)
Creates a
QueryParameterValue object with a type of DATETIME. |
static QueryParameterValue |
float64(Double value)
Creates a
QueryParameterValue object with a type of FLOAT64. |
static QueryParameterValue |
float64(Float value)
Creates a
QueryParameterValue object with a type of FLOAT64. |
abstract StandardSQLTypeName |
getArrayType()
Returns the data type of the array elements.
|
List<QueryParameterValue> |
getArrayValues()
Returns the array values of this parameter.
|
abstract StandardSQLTypeName |
getType()
Returns the data type of this parameter.
|
abstract String |
getValue()
Returns the value of this parameter.
|
static QueryParameterValue |
int64(Integer value)
Creates a
QueryParameterValue object with a type of INT64. |
static QueryParameterValue |
int64(Long value)
Creates a
QueryParameterValue object with a type of INT64. |
static QueryParameterValue.Builder |
newBuilder()
Returns a builder for the
QueryParameterValue object. |
static QueryParameterValue |
numeric(BigDecimal value)
Creates a
QueryParameterValue object with a type of NUMERIC. |
static <T> QueryParameterValue |
of(T value,
Class<T> type)
Creates a
QueryParameterValue object with the given value and type. |
static <T> QueryParameterValue |
of(T value,
StandardSQLTypeName type)
Creates a
QueryParameterValue object with the given value and type. |
static QueryParameterValue |
string(String value)
Creates a
QueryParameterValue object with a type of STRING. |
static QueryParameterValue |
time(String value)
Creates a
QueryParameterValue object with a type of TIME. |
static QueryParameterValue |
timestamp(Long value)
Creates a
QueryParameterValue object with a type of TIMESTAMP. |
static QueryParameterValue |
timestamp(String value)
Creates a
QueryParameterValue object with a type of TIMESTAMP. |
abstract QueryParameterValue.Builder |
toBuilder()
Returns a builder for a QueryParameterValue object with given value.
|
@Nullable public List<QueryParameterValue> getArrayValues()
public abstract StandardSQLTypeName getType()
@Nullable public abstract StandardSQLTypeName getArrayType()
public static <T> QueryParameterValue of(T value, Class<T> type)
QueryParameterValue
object with the given value and type.public static <T> QueryParameterValue of(T value, StandardSQLTypeName type)
QueryParameterValue
object with the given value and type.public static QueryParameterValue bool(Boolean value)
QueryParameterValue
object with a type of BOOL.public static QueryParameterValue int64(Long value)
QueryParameterValue
object with a type of INT64.public static QueryParameterValue int64(Integer value)
QueryParameterValue
object with a type of INT64.public static QueryParameterValue float64(Double value)
QueryParameterValue
object with a type of FLOAT64.public static QueryParameterValue float64(Float value)
QueryParameterValue
object with a type of FLOAT64.public static QueryParameterValue numeric(BigDecimal value)
QueryParameterValue
object with a type of NUMERIC.public static QueryParameterValue string(String value)
QueryParameterValue
object with a type of STRING.public static QueryParameterValue bytes(byte[] value)
QueryParameterValue
object with a type of BYTES.public static QueryParameterValue timestamp(Long value)
QueryParameterValue
object with a type of TIMESTAMP.public static QueryParameterValue timestamp(String value)
QueryParameterValue
object with a type of TIMESTAMP. Must be in the format
"yyyy-MM-dd HH:mm:ss.SSSSSSZZ", e.g. "2014-08-19 12:41:35.220000+00:00".public static QueryParameterValue date(String value)
QueryParameterValue
object with a type of DATE. Must be in the format
"yyyy-MM-dd", e.g. "2014-08-19".public static QueryParameterValue time(String value)
QueryParameterValue
object with a type of TIME. Must be in the format
"HH:mm:ss.SSSSSS", e.g. "12:41:35.220000".public static QueryParameterValue dateTime(String value)
QueryParameterValue
object with a type of DATETIME. Must be in the format
"yyyy-MM-dd HH:mm:ss.SSSSSS", e.g. ""2014-08-19 12:41:35.220000".public static <T> QueryParameterValue array(T[] array, Class<T> clazz)
QueryParameterValue
object with a type of ARRAY, and an array element type
based on the given class.public static <T> QueryParameterValue array(T[] array, StandardSQLTypeName type)
QueryParameterValue
object with a type of ARRAY the given array element type.public abstract QueryParameterValue.Builder toBuilder()
public static QueryParameterValue.Builder newBuilder()
QueryParameterValue
object.Copyright © 2019 Google LLC. All rights reserved.