Package com.clickhouse.client.data
Class ClickHouseBigDecimalValue
- java.lang.Object
-
- com.clickhouse.client.data.ClickHouseObjectValue<BigDecimal>
-
- com.clickhouse.client.data.ClickHouseBigDecimalValue
-
- All Implemented Interfaces:
ClickHouseValue
,Serializable
public class ClickHouseBigDecimalValue extends ClickHouseObjectValue<BigDecimal>
Wraper class of BigDecimal.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
ClickHouseBigDecimalValue(BigDecimal value)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description BigDecimal
asBigDecimal()
Gets value asBigDecimal
, using default scale(usually 0).BigDecimal
asBigDecimal(int scale)
Gets value asBigDecimal
.BigInteger
asBigInteger()
Gets value asBigInteger
.byte
asByte()
Gets value as byte.double
asDouble()
Gets value as double.float
asFloat()
Gets value as float.int
asInteger()
Gets value as integer.long
asLong()
Gets value as long.Object
asObject()
Gets value as an object.short
asShort()
Gets value as short.ClickHouseBigDecimalValue
copy(boolean deep)
Gets a copy of this value object.int
getScale()
static ClickHouseBigDecimalValue
of(ClickHouseValue ref, BigDecimal value)
Update value of the given object or create a new instance ifref
is null.static ClickHouseBigDecimalValue
of(BigDecimal value)
Wrap the given value.static ClickHouseBigDecimalValue
ofNull()
Create a new instance representing null value.static ClickHouseBigDecimalValue
ofNull(ClickHouseValue ref)
Update given value to null or create a new instance ifref
is null.String
toSqlExpression()
Converts the value to escaped SQL expression.ClickHouseBigDecimalValue
update(boolean value)
Updates value.ClickHouseBigDecimalValue
update(byte value)
Updates value.ClickHouseBigDecimalValue
update(char value)
Updates value.ClickHouseBigDecimalValue
update(double value)
Updates value.ClickHouseBigDecimalValue
update(float value)
Updates value.ClickHouseBigDecimalValue
update(int value)
Updates value.ClickHouseBigDecimalValue
update(long value)
Updates value.ClickHouseBigDecimalValue
update(short value)
Updates value.ClickHouseBigDecimalValue
update(ClickHouseValue value)
Updates value.ClickHouseBigDecimalValue
update(Enum<?> value)
Updates value.ClickHouseBigDecimalValue
update(Object value)
Updates value.ClickHouseBigDecimalValue
update(String value)
Updates value.ClickHouseBigDecimalValue
update(BigDecimal value)
Updates value.ClickHouseBigDecimalValue
update(BigInteger value)
Updates value.ClickHouseBigDecimalValue
update(Inet4Address value)
Updates value.ClickHouseBigDecimalValue
update(Inet6Address value)
Updates value.ClickHouseBigDecimalValue
update(LocalDate value)
Updates value.ClickHouseBigDecimalValue
update(LocalDateTime value)
Updates value.ClickHouseBigDecimalValue
update(LocalTime value)
Updates value.ClickHouseBigDecimalValue
update(UUID value)
Updates value.-
Methods inherited from class com.clickhouse.client.data.ClickHouseObjectValue
asString, equals, getValue, hashCode, isNullOrEmpty, resetToNullOrEmpty, set, toString
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface com.clickhouse.client.ClickHouseValue
asArray, asArray, asBinary, asBinary, asBinary, asBinary, asBoolean, asByteStream, asCharacter, asCharacterStream, asDate, asDateTime, asDateTime, asEnum, asInet4Address, asInet6Address, asInstant, asInstant, asMap, asMap, asObject, asOffsetDateTime, asOffsetDateTime, 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, updateUnknown
-
-
-
-
Constructor Detail
-
ClickHouseBigDecimalValue
protected ClickHouseBigDecimalValue(BigDecimal value)
-
-
Method Detail
-
ofNull
public static ClickHouseBigDecimalValue ofNull()
Create a new instance representing null value.- Returns:
- new instance representing null value
-
ofNull
public static ClickHouseBigDecimalValue ofNull(ClickHouseValue ref)
Update given value to null or create a new instance ifref
is null.- Parameters:
ref
- object to update, could be null- Returns:
- same object as
ref
or a new instance if it's null
-
of
public static ClickHouseBigDecimalValue of(BigDecimal value)
Wrap the given value.- Parameters:
value
- value- Returns:
- object representing the value
-
of
public static ClickHouseBigDecimalValue of(ClickHouseValue ref, BigDecimal value)
Update value of the given object or create a new instance ifref
is null.- Parameters:
ref
- object to update, could be nullvalue
- value- Returns:
- same object as
ref
or a new instance if it's null
-
copy
public ClickHouseBigDecimalValue copy(boolean deep)
Description copied from interface:ClickHouseValue
Gets 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
-
asByte
public byte asByte()
Description copied from interface:ClickHouseValue
Gets value as byte.- Specified by:
asByte
in interfaceClickHouseValue
- Overrides:
asByte
in classClickHouseObjectValue<BigDecimal>
- Returns:
- byte value
-
asShort
public short asShort()
Description copied from interface:ClickHouseValue
Gets value as short.- Specified by:
asShort
in interfaceClickHouseValue
- Overrides:
asShort
in classClickHouseObjectValue<BigDecimal>
- Returns:
- short value
-
asInteger
public int asInteger()
Description copied from interface:ClickHouseValue
Gets value as integer.- Specified by:
asInteger
in interfaceClickHouseValue
- Overrides:
asInteger
in classClickHouseObjectValue<BigDecimal>
- Returns:
- integer value
-
asLong
public long asLong()
Description copied from interface:ClickHouseValue
Gets value as long.- Specified by:
asLong
in interfaceClickHouseValue
- Overrides:
asLong
in classClickHouseObjectValue<BigDecimal>
- Returns:
- long value
-
asBigInteger
public BigInteger asBigInteger()
Description copied from interface:ClickHouseValue
Gets value asBigInteger
.- Specified by:
asBigInteger
in interfaceClickHouseValue
- Overrides:
asBigInteger
in classClickHouseObjectValue<BigDecimal>
- Returns:
- big integer, could be null
-
asFloat
public float asFloat()
Description copied from interface:ClickHouseValue
Gets value as float.- Specified by:
asFloat
in interfaceClickHouseValue
- Overrides:
asFloat
in classClickHouseObjectValue<BigDecimal>
- Returns:
- float value
-
asDouble
public double asDouble()
Description copied from interface:ClickHouseValue
Gets value as double.- Specified by:
asDouble
in interfaceClickHouseValue
- Overrides:
asDouble
in classClickHouseObjectValue<BigDecimal>
- Returns:
- double value
-
asBigDecimal
public BigDecimal asBigDecimal()
Description copied from interface:ClickHouseValue
Gets value asBigDecimal
, using default scale(usually 0).- Returns:
- big decimal, could be null
-
asBigDecimal
public BigDecimal asBigDecimal(int scale)
Description copied from interface:ClickHouseValue
Gets value asBigDecimal
.- Specified by:
asBigDecimal
in interfaceClickHouseValue
- Overrides:
asBigDecimal
in classClickHouseObjectValue<BigDecimal>
- Parameters:
scale
- scale of the decimal- Returns:
- big decimal, could be null
-
asObject
public Object asObject()
Description copied from interface:ClickHouseValue
Gets value as an object.- Specified by:
asObject
in interfaceClickHouseValue
- Overrides:
asObject
in classClickHouseObjectValue<BigDecimal>
- Returns:
- an object representing the value, could be null
-
getScale
public int getScale()
-
toSqlExpression
public String toSqlExpression()
Description copied from interface:ClickHouseValue
Converts 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:
toSqlExpression
in interfaceClickHouseValue
- Overrides:
toSqlExpression
in classClickHouseObjectValue<BigDecimal>
- Returns:
- escaped SQL expression
-
update
public ClickHouseBigDecimalValue update(boolean value)
Description copied from interface:ClickHouseValue
Updates value.- Parameters:
value
- value to update- Returns:
- this object
-
update
public ClickHouseBigDecimalValue update(char value)
Description copied from interface:ClickHouseValue
Updates value.- Parameters:
value
- value to update- Returns:
- this object
-
update
public ClickHouseBigDecimalValue update(byte value)
Description copied from interface:ClickHouseValue
Updates value.- Parameters:
value
- value to update- Returns:
- this object
-
update
public ClickHouseBigDecimalValue update(short value)
Description copied from interface:ClickHouseValue
Updates value.- Parameters:
value
- value to update- Returns:
- this object
-
update
public ClickHouseBigDecimalValue update(int value)
Description copied from interface:ClickHouseValue
Updates value.- Parameters:
value
- value to update- Returns:
- this object
-
update
public ClickHouseBigDecimalValue update(long value)
Description copied from interface:ClickHouseValue
Updates value.- Parameters:
value
- value to update- Returns:
- this object
-
update
public ClickHouseBigDecimalValue update(float value)
Description copied from interface:ClickHouseValue
Updates value.- Parameters:
value
- value to update- Returns:
- this object
-
update
public ClickHouseBigDecimalValue update(double value)
Description copied from interface:ClickHouseValue
Updates value.- Parameters:
value
- value to update- Returns:
- this object
-
update
public ClickHouseBigDecimalValue update(BigInteger value)
Description copied from interface:ClickHouseValue
Updates value.- Parameters:
value
- value to update- Returns:
- this object
-
update
public ClickHouseBigDecimalValue update(BigDecimal value)
Description copied from interface:ClickHouseValue
Updates value.- Parameters:
value
- value to update- Returns:
- this object
-
update
public ClickHouseBigDecimalValue update(Enum<?> value)
Description copied from interface:ClickHouseValue
Updates value.- Parameters:
value
- value to update- Returns:
- this object
-
update
public ClickHouseBigDecimalValue update(Inet4Address value)
Description copied from interface:ClickHouseValue
Updates value.- Parameters:
value
- value to update- Returns:
- this object
-
update
public ClickHouseBigDecimalValue update(Inet6Address value)
Description copied from interface:ClickHouseValue
Updates value.- Parameters:
value
- value to update- Returns:
- this object
-
update
public ClickHouseBigDecimalValue update(LocalDate value)
Description copied from interface:ClickHouseValue
Updates value.- Parameters:
value
- value to update- Returns:
- this object
-
update
public ClickHouseBigDecimalValue update(LocalTime value)
Description copied from interface:ClickHouseValue
Updates value.- Parameters:
value
- value to update- Returns:
- this object
-
update
public ClickHouseBigDecimalValue update(LocalDateTime value)
Description copied from interface:ClickHouseValue
Updates value.- Parameters:
value
- value to update- Returns:
- this object
-
update
public ClickHouseBigDecimalValue update(String value)
Description copied from interface:ClickHouseValue
Updates value.- Parameters:
value
- value to update- Returns:
- this object
-
update
public ClickHouseBigDecimalValue update(UUID value)
Description copied from interface:ClickHouseValue
Updates value.- Parameters:
value
- value to update- Returns:
- this object
-
update
public ClickHouseBigDecimalValue update(ClickHouseValue value)
Description copied from interface:ClickHouseValue
Updates value.- Parameters:
value
- value to update- Returns:
- this object
-
update
public ClickHouseBigDecimalValue update(Object value)
Description copied from interface:ClickHouseValue
Updates value. This method tries to identify type ofvalue
and then use corresponding update method to proceed. Unknown value will be passed toClickHouseValue.updateUnknown(Object)
.- Specified by:
update
in interfaceClickHouseValue
- Overrides:
update
in classClickHouseObjectValue<BigDecimal>
- Parameters:
value
- value to update, could be null- Returns:
- this object
-
-