Package org.apache.flink.cdc.common.data
Class LocalZonedTimestampData
- java.lang.Object
-
- org.apache.flink.cdc.common.data.LocalZonedTimestampData
-
- All Implemented Interfaces:
Comparable<LocalZonedTimestampData>
@PublicEvolving public final class LocalZonedTimestampData extends Object implements Comparable<LocalZonedTimestampData>
An internal data structure representing data ofLocalZonedTimestampType.This data structure is immutable and consists of a epoch milliseconds and epoch nanos-of-millisecond since epoch
1970-01-01 00:00:00. It might be stored in a compact representation (as a long value) if values are small enough.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description intcompareTo(LocalZonedTimestampData that)booleanequals(Object obj)static LocalZonedTimestampDatafromEpochMillis(long millisecond)Creates an instance ofLocalZonedTimestampDatafrom epoch milliseconds.static LocalZonedTimestampDatafromEpochMillis(long millisecond, int epochNanoOfMillisecond)Creates an instance ofLocalZonedTimestampDatafrom epoch milliseconds and a epoch nanos-of-millisecond.static LocalZonedTimestampDatafromInstant(java.time.Instant instant)Creates an instance ofLocalZonedTimestampDatafrom an instance ofInstant.longgetEpochMillisecond()Returns the number of epoch milliseconds since epoch1970-01-01 00:00:00.intgetEpochNanoOfMillisecond()Returns the number of epoch nanoseconds (the nanoseconds within the milliseconds).inthashCode()static booleanisCompact(int precision)Returns whether the local zoned timestamp data is small enough to be stored in a long of milliseconds.java.time.InstanttoInstant()Converts thisLocalZonedTimestampDataobject to aInstant.StringtoString()
-
-
-
Method Detail
-
getEpochMillisecond
public long getEpochMillisecond()
Returns the number of epoch milliseconds since epoch1970-01-01 00:00:00.
-
getEpochNanoOfMillisecond
public int getEpochNanoOfMillisecond()
Returns the number of epoch nanoseconds (the nanoseconds within the milliseconds).The value range is from 0 to 999,999.
-
toInstant
public java.time.Instant toInstant()
Converts thisLocalZonedTimestampDataobject to aInstant.
-
compareTo
public int compareTo(LocalZonedTimestampData that)
- Specified by:
compareToin interfaceComparable<LocalZonedTimestampData>
-
fromEpochMillis
public static LocalZonedTimestampData fromEpochMillis(long millisecond)
Creates an instance ofLocalZonedTimestampDatafrom epoch milliseconds.The nanos-of-millisecond field will be set to zero.
- Parameters:
millisecond- the number of epoch milliseconds since epoch1970-01-01 00:00:00; a negative number is the number of epoch milliseconds before epoch1970-01-01 00:00:00
-
fromEpochMillis
public static LocalZonedTimestampData fromEpochMillis(long millisecond, int epochNanoOfMillisecond)
Creates an instance ofLocalZonedTimestampDatafrom epoch milliseconds and a epoch nanos-of-millisecond.- Parameters:
millisecond- the number of epoch milliseconds since epoch1970-01-01 00:00:00; a negative number is the number of epoch milliseconds before epoch1970-01-01 00:00:00epochNanoOfMillisecond- the epoch nanoseconds within the millisecond, from 0 to 999,999
-
fromInstant
public static LocalZonedTimestampData fromInstant(java.time.Instant instant)
Creates an instance ofLocalZonedTimestampDatafrom an instance ofInstant.- Parameters:
instant- an instance ofInstant
-
isCompact
public static boolean isCompact(int precision)
Returns whether the local zoned timestamp data is small enough to be stored in a long of milliseconds.
-
-