Package com.clickhouse.data.value
Class ClickHouseTupleValue
java.lang.Object
com.clickhouse.data.value.ClickHouseObjectValue<List<Object>>
com.clickhouse.data.value.ClickHouseTupleValue
- All Implemented Interfaces:
ClickHouseValue,Serializable
Wrapper class of Tuple.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionObject[]asArray()Gets value as an object array.<T> T[]Gets value as an array.asMap()Gets value as a map.<K,V> Map<K, V> Gets value as a map.asString()Gets value as unbounded string, using default charset(usually UTF-8).asTuple()Gets value as ordered list(tuple).copy(boolean deep) Gets a copy of this value object.booleanprotected ObjectinthashCode()booleanChecks whether the value is nullable.booleanChecks if the value is null, or empty for non-null types like Array, Tuple and Map.static ClickHouseTupleValueof(ClickHouseValue ref, List<Object> value) Update value of the given object or create a new instance ifrefis null.static ClickHouseTupleValueWrap the given value.Resets to default value of corresponding data type.Resets value to null, or empty when null is not supported(e.g.Converts the value to escaped SQL expression.update(boolean[] value) Updates value.update(byte value) Updates value.update(byte[] value) Updates value.update(char[] value) Updates value.update(double value) Updates value.update(double[] value) Updates value.update(float value) Updates value.update(float[] value) Updates value.update(int value) Updates value.update(int[] value) Updates value.update(long value) Updates value.update(long[] value) Updates value.update(short value) Updates value.update(short[] value) Updates value.update(ClickHouseValue value) Updates value.Updates value.Updates value.Updates value.Updates value.update(BigDecimal value) Updates value.update(BigInteger value) Updates value.update(Inet4Address value) Updates value.update(Inet6Address value) Updates value.Updates value.update(LocalDateTime value) Updates value.Updates value.update(Collection<?> value) Updates value.update(Enumeration<?> value) Updates value.Updates value.Updates value.Methods inherited from class com.clickhouse.data.value.ClickHouseObjectValue
asBigDecimal, asBigInteger, asByte, asDouble, asFloat, asInteger, asLong, asObject, asShort, getValue, set, toStringMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface com.clickhouse.data.ClickHouseValue
asBigDecimal, asBinary, asBinary, asBinary, asBinary, asBoolean, asByteStream, asCharacter, asCharacterStream, asDate, asDateTime, asDateTime, asEnum, asInet4Address, asInet6Address, asInstant, asInstant, asObject, asOffsetDateTime, asOffsetDateTime, asRawObject, asTime, asTime, asUuid, asZonedDateTime, asZonedDateTime, copy, isInfinity, isNaN, newUnsupportedException, update, update, update, update, update, update, update, updateUnknown
-
Constructor Details
-
ClickHouseTupleValue
-
-
Method Details
-
of
Wrap the given value.- Parameters:
value- value- Returns:
- object representing the value
-
of
Update value of the given object or create a new instance ifrefis null.- Parameters:
ref- object to update, could be nullvalue- value- Returns:
- same object as
refor a new instance if it's null
-
getSingleValue
-
copy
Description copied from interface:ClickHouseValueGets a copy of this value object.- Parameters:
deep- true to create a deep copy; false for a shallow copy- Returns:
- copy of this value object
-
asArray
Description copied from interface:ClickHouseValueGets value as an object array.- Returns:
- non-null object array
-
asArray
Description copied from interface:ClickHouseValueGets value as an array.- Type Parameters:
T- type of the element- Parameters:
clazz- class of the element- Returns:
- non-null array
-
asMap
Description copied from interface:ClickHouseValueGets value as a map.- Returns:
- non-null map value
-
asMap
Description copied from interface:ClickHouseValueGets value as a map.- Type Parameters:
K- type of keyV- type of value- Parameters:
keyClass- non-null class of keyvalueClass- non-null class of value- Returns:
- non-null map value
-
asString
Description copied from interface:ClickHouseValueGets value as unbounded string, using default charset(usually UTF-8).- Specified by:
asStringin interfaceClickHouseValue- Overrides:
asStringin classClickHouseObjectValue<List<Object>>- Returns:
- string value, could be null
-
asTuple
Description copied from interface:ClickHouseValueGets value as ordered list(tuple).- Returns:
- non-null list
-
isNullable
public boolean isNullable()Description copied from interface:ClickHouseValueChecks whether the value is nullable. This always returnsfalsefor nested value type.- Returns:
- true if the value is nullable; false otherwise
-
isNullOrEmpty
public boolean isNullOrEmpty()Description copied from interface:ClickHouseValueChecks if the value is null, or empty for non-null types like Array, Tuple and Map.Please pay attention that only nullability will be considered for String, meaning this method will return
falsefor an empty string. This is because String is treated as value-based type instead of a container like Array.- Specified by:
isNullOrEmptyin interfaceClickHouseValue- Overrides:
isNullOrEmptyin classClickHouseObjectValue<List<Object>>- Returns:
- true if the value is null or empty; false otherwise
-
resetToDefault
Description copied from interface:ClickHouseValueResets to default value of corresponding data type.- Returns:
- this object
-
resetToNullOrEmpty
Description copied from interface:ClickHouseValueResets value to null, or empty when null is not supported(e.g. Array, Tuple and Map etc.).Keep in mind that String is value-based type, so this method will change its value to null instead of an empty string.
- Specified by:
resetToNullOrEmptyin interfaceClickHouseValue- Overrides:
resetToNullOrEmptyin classClickHouseObjectValue<List<Object>>- Returns:
- this object
-
toSqlExpression
Description copied from interface:ClickHouseValueConverts the value to escaped SQL expression. For example, number 123 will be converted to123, while string "12'3" will be converted to @{code '12\'3'}.- Specified by:
toSqlExpressionin interfaceClickHouseValue- Overrides:
toSqlExpressionin classClickHouseObjectValue<List<Object>>- Returns:
- escaped SQL expression
-
update
Description copied from interface:ClickHouseValueUpdates value.- Parameters:
value- value to update- Returns:
- this object
-
update
Description copied from interface:ClickHouseValueUpdates value.- Parameters:
value- value to update- Returns:
- this object
-
update
Description copied from interface:ClickHouseValueUpdates value.- Parameters:
value- value to update- Returns:
- this object
-
update
Description copied from interface:ClickHouseValueUpdates value.- Parameters:
value- value to update- Returns:
- this object
-
update
Description copied from interface:ClickHouseValueUpdates value.- Parameters:
value- value to update- Returns:
- this object
-
update
Description copied from interface:ClickHouseValueUpdates value.- Parameters:
value- value to update- Returns:
- this object
-
update
Description copied from interface:ClickHouseValueUpdates value.- Parameters:
value- value to update- Returns:
- this object
-
update
Description copied from interface:ClickHouseValueUpdates value.- Parameters:
value- value to update- Returns:
- this object
-
update
Description copied from interface:ClickHouseValueUpdates value.- Parameters:
value- value to update- Returns:
- this object
-
update
Description copied from interface:ClickHouseValueUpdates value.- Parameters:
value- value to update- Returns:
- this object
-
update
Description copied from interface:ClickHouseValueUpdates value.- Parameters:
value- value to update- Returns:
- this object
-
update
Description copied from interface:ClickHouseValueUpdates value.- Parameters:
value- value to update- Returns:
- this object
-
update
Description copied from interface:ClickHouseValueUpdates value.- Parameters:
value- value to update- Returns:
- this object
-
update
Description copied from interface:ClickHouseValueUpdates value.- Parameters:
value- value to update- Returns:
- this object
-
update
Description copied from interface:ClickHouseValueUpdates value.- Parameters:
value- value to update- Returns:
- this object
-
update
Description copied from interface:ClickHouseValueUpdates value.- Parameters:
value- value to update- Returns:
- this object
-
update
Description copied from interface:ClickHouseValueUpdates value.- Parameters:
value- value to update- Returns:
- this object
-
update
Description copied from interface:ClickHouseValueUpdates value.- Parameters:
value- value to update- Returns:
- this object
-
update
Description copied from interface:ClickHouseValueUpdates value.- Parameters:
value- value to update- Returns:
- this object
-
update
Description copied from interface:ClickHouseValueUpdates value.- Parameters:
value- value to update- Returns:
- this object
-
update
Description copied from interface:ClickHouseValueUpdates value.- Parameters:
value- value to update- Returns:
- this object
-
update
Description copied from interface:ClickHouseValueUpdates value.- Parameters:
value- value to update- Returns:
- this object
-
update
Description copied from interface:ClickHouseValueUpdates value.- Parameters:
value- value to update- Returns:
- this object
-
update
Description copied from interface:ClickHouseValueUpdates value.- Parameters:
value- value to update- Returns:
- this object
-
update
Description copied from interface:ClickHouseValueUpdates value.- Parameters:
value- value to update- Returns:
- this object
-
update
Description copied from interface:ClickHouseValueUpdates value.- Parameters:
value- value to update- Returns:
- this object
-
update
Description copied from interface:ClickHouseValueUpdates value.- Parameters:
value- value to update- Returns:
- this object
-
update
Description copied from interface:ClickHouseValueUpdates value.- Parameters:
value- value to update- Returns:
- this object
-
update
Description copied from interface:ClickHouseValueUpdates value.- Parameters:
value- value to update- Returns:
- this object
-
update
Description copied from interface:ClickHouseValueUpdates value. This method tries to identify type ofvalueand then use corresponding update method to proceed. Unknown value will be passed toClickHouseValue.updateUnknown(Object).- Specified by:
updatein interfaceClickHouseValue- Overrides:
updatein classClickHouseObjectValue<List<Object>>- Parameters:
value- value to update, could be null- Returns:
- this object
-
equals
- Overrides:
equalsin classClickHouseObjectValue<List<Object>>
-
hashCode
public int hashCode()- Overrides:
hashCodein classClickHouseObjectValue<List<Object>>
-