Package com.clickhouse.data.value
Class ClickHouseDateTimeValue
java.lang.Object
com.clickhouse.data.value.ClickHouseObjectValue<LocalDateTime>
com.clickhouse.data.value.ClickHouseDateTimeValue
- All Implemented Interfaces:
ClickHouseValue,Serializable
Wrapper class of
LocalDateTime.- See Also:
-
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedClickHouseDateTimeValue(LocalDateTime value, int scale, TimeZone tz) -
Method Summary
Modifier and TypeMethodDescriptionasBigDecimal(int scale) Gets value asBigDecimal.Gets value asBigInteger.byteasByte()Gets value as byte.asDate()Gets value asLocalDate.asDateTime(int scale) Gets value asLocalDateTime.doubleasDouble()Gets value as double.floatasFloat()Gets value as float.asInstant(int scale) Gets value asInstant.intGets value as integer.longasLong()Gets value as long.asObject()Gets value as an object.asOffsetDateTime(int scale) Gets value asOffsetDateTime.shortasShort()Gets value as short.asString()Gets value as unbounded string, using default charset(usually UTF-8).asZonedDateTime(int scale) Gets value asZonedDateTime.copy(boolean deep) Gets a copy of this value object.intgetScale()static ClickHouseDateTimeValueof(ClickHouseValue ref, String value, int scale, TimeZone tz) Update value of the given object or create a new instance ifrefis null.static ClickHouseDateTimeValueof(ClickHouseValue ref, LocalDateTime value, int scale, TimeZone tz) Update value of the given object or create a new instance ifrefis null.static ClickHouseDateTimeValueWrap the given getValue().static ClickHouseDateTimeValueof(LocalDateTime value, int scale, TimeZone tz) Wrap the given getValue().static ClickHouseDateTimeValueCreate a new instance representing null getValue().static ClickHouseDateTimeValueofNull(ClickHouseValue ref, int scale, TimeZone tz) Update given value to null or create a new instance ifrefis null.Resets to default value of corresponding data type.Converts the value to escaped SQL expression.update(byte value) Updates value.update(double value) Updates value.update(float value) Updates value.update(int value) Updates value.update(long value) Updates value.update(short value) Updates value.update(ClickHouseValue value) Updates value.Updates value.Updates value.Updates value.update(BigDecimal value) Updates value.update(BigInteger value) Updates value.Updates value.Updates value.update(LocalDateTime value) Updates value.Updates value.update(OffsetDateTime value) Updates value.update(ZonedDateTime value) Updates value.Methods inherited from class com.clickhouse.data.value.ClickHouseObjectValue
equals, getValue, hashCode, isNullOrEmpty, resetToNullOrEmpty, set, toStringMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface com.clickhouse.data.ClickHouseValue
asArray, asArray, asBigDecimal, asBinary, asBinary, asBinary, asBinary, asBoolean, asByteStream, asCharacter, asCharacterStream, asDateTime, asEnum, asInet4Address, asInet6Address, asInstant, asMap, asMap, asObject, asOffsetDateTime, asRawObject, asTime, asTime, asTuple, asUuid, asZonedDateTime, copy, isInfinity, isNaN, isNullable, newUnsupportedException, update, update, update, update, update, update, update, update, update, update, update, update, update, update, update, update, update, update, update, updateUnknown
-
Field Details
-
DEFAULT
Default value.
-
-
Constructor Details
-
ClickHouseDateTimeValue
-
-
Method Details
-
ofNull
Create a new instance representing null getValue().- Parameters:
scale- scaletz- time zone, null is treated asUTC- Returns:
- new instance representing null value
-
ofNull
Update given value to null or create a new instance ifrefis null.- Parameters:
ref- object to update, could be nullscale- scale, only used whenrefis nulltz- time zone, null is treated asUTC- Returns:
- same object as
refor a new instance if it's null
-
of
Wrap the given getValue().- Parameters:
value- valuescale- scaletz- time zone, null is treated asUTC- Returns:
- object representing the value
-
of
Wrap the given getValue().- Parameters:
value- UTC date time in stringscale- scaletz- time zone, null is treated asUTC- Returns:
- object representing the value
-
of
public static ClickHouseDateTimeValue of(ClickHouseValue ref, LocalDateTime value, int scale, TimeZone tz) Update value of the given object or create a new instance ifrefis null.- Parameters:
ref- object to update, could be nullvalue- valuescale- scale, only used whenrefis nulltz- time zone, null is treated asUTC- Returns:
- same object as
refor a new instance if it's null
-
of
Update value of the given object or create a new instance ifrefis null.- Parameters:
ref- object to update, could be nullvalue- UTC date time in stringscale- scaletz- time zone, null is treated asUTC- Returns:
- same object as
refor a new instance if it's null
-
getScale
public int getScale() -
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
-
asByte
public byte asByte()Description copied from interface:ClickHouseValueGets value as byte.- Specified by:
asBytein interfaceClickHouseValue- Overrides:
asBytein classClickHouseObjectValue<LocalDateTime>- Returns:
- byte value
-
asShort
public short asShort()Description copied from interface:ClickHouseValueGets value as short.- Specified by:
asShortin interfaceClickHouseValue- Overrides:
asShortin classClickHouseObjectValue<LocalDateTime>- Returns:
- short value
-
asInteger
public int asInteger()Description copied from interface:ClickHouseValueGets value as integer.- Specified by:
asIntegerin interfaceClickHouseValue- Overrides:
asIntegerin classClickHouseObjectValue<LocalDateTime>- Returns:
- integer value
-
asLong
public long asLong()Description copied from interface:ClickHouseValueGets value as long.- Specified by:
asLongin interfaceClickHouseValue- Overrides:
asLongin classClickHouseObjectValue<LocalDateTime>- Returns:
- long value
-
asFloat
public float asFloat()Description copied from interface:ClickHouseValueGets value as float.- Specified by:
asFloatin interfaceClickHouseValue- Overrides:
asFloatin classClickHouseObjectValue<LocalDateTime>- Returns:
- float value
-
asDouble
public double asDouble()Description copied from interface:ClickHouseValueGets value as double.- Specified by:
asDoublein interfaceClickHouseValue- Overrides:
asDoublein classClickHouseObjectValue<LocalDateTime>- Returns:
- double value
-
asBigInteger
Description copied from interface:ClickHouseValueGets value asBigInteger.- Specified by:
asBigIntegerin interfaceClickHouseValue- Overrides:
asBigIntegerin classClickHouseObjectValue<LocalDateTime>- Returns:
- big integer, could be null
-
asBigDecimal
Description copied from interface:ClickHouseValueGets value asBigDecimal.- Specified by:
asBigDecimalin interfaceClickHouseValue- Overrides:
asBigDecimalin classClickHouseObjectValue<LocalDateTime>- Parameters:
scale- scale of the decimal- Returns:
- big decimal, could be null
-
asDate
Description copied from interface:ClickHouseValueGets value asLocalDate.- Returns:
- date, could be null
-
asDateTime
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
-
asInstant
Description copied from interface:ClickHouseValueGets value asInstant.- Parameters:
scale- scale of the date time, between 0 (second) and 9 (nano second)- Returns:
- instant, could be null
-
asOffsetDateTime
Description copied from interface:ClickHouseValueGets value asOffsetDateTime.- Parameters:
scale- scale of the date time, between 0 (second) and 9 (nano second)- Returns:
- date time, could be null
-
asZonedDateTime
Description copied from interface:ClickHouseValueGets value asZonedDateTime.- Parameters:
scale- scale of the date time, between 0 (second) and 9 (nano second)- Returns:
- date time, could be null
-
asObject
Description copied from interface:ClickHouseValueGets value as an object.- Specified by:
asObjectin interfaceClickHouseValue- Overrides:
asObjectin classClickHouseObjectValue<LocalDateTime>- Returns:
- an object representing the value, could be null
-
asString
Description copied from interface:ClickHouseValueGets value as unbounded string, using default charset(usually UTF-8).- Specified by:
asStringin interfaceClickHouseValue- Overrides:
asStringin classClickHouseObjectValue<LocalDateTime>- Returns:
- string value, could be null
-
resetToDefault
Description copied from interface:ClickHouseValueResets to default value of corresponding data type.- 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<LocalDateTime>- 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. 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<LocalDateTime>- Parameters:
value- value to update, could be null- Returns:
- this object
-