Package com.clickhouse.client.data
Class ClickHouseEmptyValue
- java.lang.Object
-
- com.clickhouse.client.data.ClickHouseEmptyValue
-
- All Implemented Interfaces:
ClickHouseValue,Serializable
public final class ClickHouseEmptyValue extends Object implements ClickHouseValue
Wrapper class of Nothing.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static ClickHouseEmptyValueINSTANCESingleton.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description BigDecimalasBigDecimal(int scale)Gets value asBigDecimal.BigIntegerasBigInteger()Gets value asBigInteger.byteasByte()Gets value as byte.doubleasDouble()Gets value as double.floatasFloat()Gets value as float.intasInteger()Gets value as integer.longasLong()Gets value as long.ObjectasObject()Gets value as an object.shortasShort()Gets value as short.ClickHouseValuecopy(boolean deep)Gets a copy of this value object.booleanisNullOrEmpty()Checks if the value is null, or empty for non-null types like Array, Tuple and Map.ClickHouseValueresetToNullOrEmpty()Resets value to null, or empty when null is not supported(e.g.StringtoSqlExpression()Converts the value to escaped SQL expression.StringtoString()ClickHouseValueupdate(byte value)Updates value.ClickHouseValueupdate(double value)Updates value.ClickHouseValueupdate(float value)Updates value.ClickHouseValueupdate(int value)Updates value.ClickHouseValueupdate(long value)Updates value.ClickHouseValueupdate(short value)Updates value.ClickHouseValueupdate(ClickHouseValue value)Updates value.ClickHouseValueupdate(String value)Updates value.ClickHouseValueupdate(BigDecimal value)Updates value.ClickHouseValueupdate(BigInteger value)Updates value.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface com.clickhouse.client.ClickHouseValue
asArray, asArray, asBigDecimal, asBoolean, asByteStream, asCharacter, asCharacterStream, asDate, asDateTime, asDateTime, asEnum, asInet4Address, asInet6Address, asInstant, asInstant, asMap, asMap, asObject, asOffsetDateTime, asOffsetDateTime, asString, asString, asString, asString, asTime, asTime, asTuple, asUuid, asZonedDateTime, asZonedDateTime, copy, isInfinity, isNaN, newUnsupportedException, update, update, update, update, update, update, update, update, update, update, update, update, update, update, update, update, update, update, update, update, update, update, update, update, update, update, update, updateUnknown
-
-
-
-
Field Detail
-
INSTANCE
public static final ClickHouseEmptyValue INSTANCE
Singleton.
-
-
Method Detail
-
asBigDecimal
public BigDecimal asBigDecimal(int scale)
Description copied from interface:ClickHouseValueGets value asBigDecimal.- Specified by:
asBigDecimalin interfaceClickHouseValue- Parameters:
scale- scale of the decimal- Returns:
- big decimal, could be null
-
asBigInteger
public BigInteger asBigInteger()
Description copied from interface:ClickHouseValueGets value asBigInteger.- Specified by:
asBigIntegerin interfaceClickHouseValue- Returns:
- big integer, could be null
-
asByte
public byte asByte()
Description copied from interface:ClickHouseValueGets value as byte.- Specified by:
asBytein interfaceClickHouseValue- Returns:
- byte value
-
asDouble
public double asDouble()
Description copied from interface:ClickHouseValueGets value as double.- Specified by:
asDoublein interfaceClickHouseValue- Returns:
- double value
-
asFloat
public float asFloat()
Description copied from interface:ClickHouseValueGets value as float.- Specified by:
asFloatin interfaceClickHouseValue- Returns:
- float value
-
asInteger
public int asInteger()
Description copied from interface:ClickHouseValueGets value as integer.- Specified by:
asIntegerin interfaceClickHouseValue- Returns:
- integer value
-
asLong
public long asLong()
Description copied from interface:ClickHouseValueGets value as long.- Specified by:
asLongin interfaceClickHouseValue- Returns:
- long value
-
asObject
public Object asObject()
Description copied from interface:ClickHouseValueGets value as an object.- Specified by:
asObjectin interfaceClickHouseValue- Returns:
- an object representing the value, could be null
-
asShort
public short asShort()
Description copied from interface:ClickHouseValueGets value as short.- Specified by:
asShortin interfaceClickHouseValue- Returns:
- short value
-
copy
public ClickHouseValue copy(boolean deep)
Description copied from interface:ClickHouseValueGets a copy of this value object.- Specified by:
copyin interfaceClickHouseValue- Parameters:
deep- true to create a deep copy; false for a shallow copy- Returns:
- copy of this value object
-
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- Returns:
- true if the value is null or empty; false otherwise
-
resetToNullOrEmpty
public ClickHouseValue 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- Returns:
- this object
-
toSqlExpression
public String 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- Returns:
- escaped SQL expression
-
update
public ClickHouseValue update(byte value)
Description copied from interface:ClickHouseValueUpdates value.- Specified by:
updatein interfaceClickHouseValue- Parameters:
value- value to update- Returns:
- this object
-
update
public ClickHouseValue update(short value)
Description copied from interface:ClickHouseValueUpdates value.- Specified by:
updatein interfaceClickHouseValue- Parameters:
value- value to update- Returns:
- this object
-
update
public ClickHouseValue update(int value)
Description copied from interface:ClickHouseValueUpdates value.- Specified by:
updatein interfaceClickHouseValue- Parameters:
value- value to update- Returns:
- this object
-
update
public ClickHouseValue update(long value)
Description copied from interface:ClickHouseValueUpdates value.- Specified by:
updatein interfaceClickHouseValue- Parameters:
value- value to update- Returns:
- this object
-
update
public ClickHouseValue update(float value)
Description copied from interface:ClickHouseValueUpdates value.- Specified by:
updatein interfaceClickHouseValue- Parameters:
value- value to update- Returns:
- this object
-
update
public ClickHouseValue update(double value)
Description copied from interface:ClickHouseValueUpdates value.- Specified by:
updatein interfaceClickHouseValue- Parameters:
value- value to update- Returns:
- this object
-
update
public ClickHouseValue update(BigInteger value)
Description copied from interface:ClickHouseValueUpdates value.- Specified by:
updatein interfaceClickHouseValue- Parameters:
value- value to update- Returns:
- this object
-
update
public ClickHouseValue update(BigDecimal value)
Description copied from interface:ClickHouseValueUpdates value.- Specified by:
updatein interfaceClickHouseValue- Parameters:
value- value to update- Returns:
- this object
-
update
public ClickHouseValue update(String value)
Description copied from interface:ClickHouseValueUpdates value.- Specified by:
updatein interfaceClickHouseValue- Parameters:
value- value to update- Returns:
- this object
-
update
public ClickHouseValue update(ClickHouseValue value)
Description copied from interface:ClickHouseValueUpdates value.- Specified by:
updatein interfaceClickHouseValue- Parameters:
value- value to update- Returns:
- this object
-
-