Class TimestampData

    • Method Detail

      • getMillisecond

        public long getMillisecond()
        Returns the number of milliseconds since 1970-01-01 00:00:00.
      • getNanoOfMillisecond

        public int getNanoOfMillisecond()
        Returns the number of nanoseconds (the nanoseconds within the milliseconds).

        The value range is from 0 to 999,999.

      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object
      • fromEpochMillis

        public static TimestampData fromEpochMillis​(long milliseconds)
        Creates an instance of TimestampData from milliseconds.

        The nanos-of-millisecond field will be set to zero.

        Parameters:
        milliseconds - the number of milliseconds since 1970-01-01 00:00:00; a negative number is the number of milliseconds before 1970-01-01 00:00:00
      • fromEpochMillis

        public static TimestampData fromEpochMillis​(long milliseconds,
                                                    int nanosOfMillisecond)
        Creates an instance of TimestampData from milliseconds and a nanos-of-millisecond.
        Parameters:
        milliseconds - the number of milliseconds since 1970-01-01 00:00:00; a negative number is the number of milliseconds before 1970-01-01 00:00:00
        nanosOfMillisecond - the nanoseconds within the millisecond, from 0 to 999,999
      • isCompact

        public static boolean isCompact​(int precision)
        Returns whether the timestamp data is small enough to be stored in a long of milliseconds.