Class Timestamp

    • Constructor Detail

      • Timestamp

        public Timestamp​(long value)
        Constructs a Timestamp from a microsecond value.
        Parameters:
        value - The number of microseconds since UNIX epoch.
    • Method Detail

      • fromMillis

        public static @NonNull Timestamp fromMillis​(long millis)
        Constructs a Timestamp from milliseconds since UNIX epoch.
        Parameters:
        millis - milliseconds since UNIX epoch.
      • fromInstant

        public static @NonNull Timestamp fromInstant​(@NonNull java.time.Instant instant)
        Constructs a Timestamp value from an Instant up to microsecond precision. This is a lossy conversion as nanoseconds are not preserved.
      • getValue

        public @NonNull java.time.Instant getValue()
        This is an alias for toInstant()
        Returns:
        the microseconds stored in this timestamp
      • getMicroseconds

        public @org.checkerframework.checker.nullness.qual.NonNull long getMicroseconds()
      • toInstant

        public java.time.Instant toInstant()
        Returns:
        The point in time represented by this timestamp as Instant.
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object