Package com.clickhouse.client.data
Class ClickHouseDateValue
- java.lang.Object
-
- com.clickhouse.client.data.ClickHouseObjectValue<LocalDate>
-
- com.clickhouse.client.data.ClickHouseDateValue
-
- All Implemented Interfaces:
ClickHouseValue,Serializable
public class ClickHouseDateValue extends ClickHouseObjectValue<LocalDate>
Wraper class of LocalDate.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedClickHouseDateValue(LocalDate value)
-
Method Summary
All Methods Static 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.LocalDateasDate()Gets value asLocalDate.LocalDateTimeasDateTime(int scale)Gets value asLocalDateTime.doubleasDouble()Gets value as double.floatasFloat()Gets value as float.intasInteger()Gets value as integer.longasLong()Gets value as long.shortasShort()Gets value as short.StringasString(int length, Charset charset)Gets value as fixed length(in bytes) string.LocalTimeasTime(int scale)Gets value asLocalTime.ClickHouseDateValuecopy(boolean deep)Gets a copy of this value object.static ClickHouseDateValueof(long epochDay)Wrap the given value.static ClickHouseDateValueof(ClickHouseValue ref, LocalDate value)Update value of the given object or create a new instance ifrefis null.static ClickHouseDateValueof(LocalDate value)Wrap the given value.static ClickHouseDateValueofNull()Create a new instance representing null value.static ClickHouseDateValueofNull(ClickHouseValue ref)Update given value to null or create a new instance ifrefis null.StringtoSqlExpression()Converts the value to escaped SQL expression.ClickHouseDateValueupdate(byte value)Updates value.ClickHouseDateValueupdate(double value)Updates value.ClickHouseDateValueupdate(float value)Updates value.ClickHouseDateValueupdate(int value)Updates value.ClickHouseDateValueupdate(long value)Updates value.ClickHouseDateValueupdate(short value)Updates value.ClickHouseDateValueupdate(ClickHouseValue value)Updates value.ClickHouseDateValueupdate(Enum<?> value)Updates value.ClickHouseDateValueupdate(Object value)Updates value.ClickHouseDateValueupdate(String value)Updates value.ClickHouseDateValueupdate(BigDecimal value)Updates value.ClickHouseDateValueupdate(BigInteger value)Updates value.ClickHouseDateValueupdate(LocalDate value)Updates value.ClickHouseDateValueupdate(LocalDateTime value)Updates value.ClickHouseDateValueupdate(LocalTime value)Updates value.-
Methods inherited from class com.clickhouse.client.data.ClickHouseObjectValue
asObject, 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, asBigDecimal, asBoolean, asByteStream, asCharacter, asCharacterStream, asDateTime, asEnum, asInet4Address, asInet6Address, asInstant, asInstant, asMap, asMap, asObject, asOffsetDateTime, asOffsetDateTime, asString, asString, asString, 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, updateUnknown
-
-
-
-
Constructor Detail
-
ClickHouseDateValue
protected ClickHouseDateValue(LocalDate value)
-
-
Method Detail
-
ofNull
public static ClickHouseDateValue ofNull()
Create a new instance representing null value.- Returns:
- new instance representing null value
-
ofNull
public static ClickHouseDateValue ofNull(ClickHouseValue ref)
Update given value to null or create a new instance ifrefis null.- Parameters:
ref- object to update, could be null- Returns:
- same object as
refor a new instance if it's null
-
of
public static ClickHouseDateValue of(LocalDate value)
Wrap the given value.- Parameters:
value- value- Returns:
- object representing the value
-
of
public static ClickHouseDateValue of(long epochDay)
Wrap the given value.- Parameters:
epochDay- epoch day- Returns:
- object representing the value
-
of
public static ClickHouseDateValue of(ClickHouseValue ref, LocalDate value)
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
-
copy
public ClickHouseDateValue copy(boolean deep)
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
-
asByte
public byte asByte()
Description copied from interface:ClickHouseValueGets value as byte.- Specified by:
asBytein interfaceClickHouseValue- Overrides:
asBytein classClickHouseObjectValue<LocalDate>- Returns:
- byte value
-
asShort
public short asShort()
Description copied from interface:ClickHouseValueGets value as short.- Specified by:
asShortin interfaceClickHouseValue- Overrides:
asShortin classClickHouseObjectValue<LocalDate>- Returns:
- short value
-
asInteger
public int asInteger()
Description copied from interface:ClickHouseValueGets value as integer.- Specified by:
asIntegerin interfaceClickHouseValue- Overrides:
asIntegerin classClickHouseObjectValue<LocalDate>- Returns:
- integer value
-
asLong
public long asLong()
Description copied from interface:ClickHouseValueGets value as long.- Specified by:
asLongin interfaceClickHouseValue- Overrides:
asLongin classClickHouseObjectValue<LocalDate>- Returns:
- long value
-
asBigInteger
public BigInteger asBigInteger()
Description copied from interface:ClickHouseValueGets value asBigInteger.- Specified by:
asBigIntegerin interfaceClickHouseValue- Overrides:
asBigIntegerin classClickHouseObjectValue<LocalDate>- Returns:
- big integer, could be null
-
asFloat
public float asFloat()
Description copied from interface:ClickHouseValueGets value as float.- Specified by:
asFloatin interfaceClickHouseValue- Overrides:
asFloatin classClickHouseObjectValue<LocalDate>- Returns:
- float value
-
asDouble
public double asDouble()
Description copied from interface:ClickHouseValueGets value as double.- Specified by:
asDoublein interfaceClickHouseValue- Overrides:
asDoublein classClickHouseObjectValue<LocalDate>- Returns:
- double value
-
asBigDecimal
public BigDecimal asBigDecimal(int scale)
Description copied from interface:ClickHouseValueGets value asBigDecimal.- Specified by:
asBigDecimalin interfaceClickHouseValue- Overrides:
asBigDecimalin classClickHouseObjectValue<LocalDate>- Parameters:
scale- scale of the decimal- Returns:
- big decimal, could be null
-
asDate
public LocalDate asDate()
Description copied from interface:ClickHouseValueGets value asLocalDate.- Returns:
- date, could be null
-
asTime
public final LocalTime asTime(int scale)
Description copied from interface:ClickHouseValueGets value asLocalTime.- Parameters:
scale- scale of the date time, between 0 (second) and 9 (nano second)- Returns:
- time, could be null
-
asDateTime
public LocalDateTime asDateTime(int scale)
Description copied from interface:ClickHouseValueGets value asLocalDateTime.- Parameters:
scale- scale of the date time, between 0 (second) and 9 (nano second)- Returns:
- date time, could be null
-
asString
public String asString(int length, Charset charset)
Description copied from interface:ClickHouseValueGets value as fixed length(in bytes) string.- Specified by:
asStringin interfaceClickHouseValue- Overrides:
asStringin classClickHouseObjectValue<LocalDate>- Parameters:
length- byte length of the string, 0 or negative number means unboundedcharset- charset, null is same as default(UTF-8)- Returns:
- string value, could be null
-
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- Overrides:
toSqlExpressionin classClickHouseObjectValue<LocalDate>- Returns:
- escaped SQL expression
-
update
public ClickHouseDateValue update(byte value)
Description copied from interface:ClickHouseValueUpdates value.- Parameters:
value- value to update- Returns:
- this object
-
update
public ClickHouseDateValue update(short value)
Description copied from interface:ClickHouseValueUpdates value.- Parameters:
value- value to update- Returns:
- this object
-
update
public ClickHouseDateValue update(int value)
Description copied from interface:ClickHouseValueUpdates value.- Parameters:
value- value to update- Returns:
- this object
-
update
public ClickHouseDateValue update(long value)
Description copied from interface:ClickHouseValueUpdates value.- Parameters:
value- value to update- Returns:
- this object
-
update
public ClickHouseDateValue update(float value)
Description copied from interface:ClickHouseValueUpdates value.- Parameters:
value- value to update- Returns:
- this object
-
update
public ClickHouseDateValue update(double value)
Description copied from interface:ClickHouseValueUpdates value.- Parameters:
value- value to update- Returns:
- this object
-
update
public ClickHouseDateValue update(BigInteger value)
Description copied from interface:ClickHouseValueUpdates value.- Parameters:
value- value to update- Returns:
- this object
-
update
public ClickHouseDateValue update(BigDecimal value)
Description copied from interface:ClickHouseValueUpdates value.- Parameters:
value- value to update- Returns:
- this object
-
update
public ClickHouseDateValue update(Enum<?> value)
Description copied from interface:ClickHouseValueUpdates value.- Parameters:
value- value to update- Returns:
- this object
-
update
public ClickHouseDateValue update(LocalDate value)
Description copied from interface:ClickHouseValueUpdates value.- Parameters:
value- value to update- Returns:
- this object
-
update
public ClickHouseDateValue update(LocalTime value)
Description copied from interface:ClickHouseValueUpdates value.- Parameters:
value- value to update- Returns:
- this object
-
update
public ClickHouseDateValue update(LocalDateTime value)
Description copied from interface:ClickHouseValueUpdates value.- Parameters:
value- value to update- Returns:
- this object
-
update
public ClickHouseDateValue update(String value)
Description copied from interface:ClickHouseValueUpdates value.- Parameters:
value- value to update- Returns:
- this object
-
update
public ClickHouseDateValue update(ClickHouseValue value)
Description copied from interface:ClickHouseValueUpdates value.- Parameters:
value- value to update- Returns:
- this object
-
update
public ClickHouseDateValue update(Object value)
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<LocalDate>- Parameters:
value- value to update, could be null- Returns:
- this object
-
-