public class Timestamp extends Value
ValueOuterClass.Value.getTimestamp()
Constructor and Description |
---|
Timestamp(long value)
Constructs a
Timestamp from a microsecond value. |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object o) |
static @NonNull Timestamp |
fromInstant(@NonNull java.time.Instant instant)
Constructs a
Timestamp value from an Instant up to microsecond precision. |
static @NonNull Timestamp |
fromMillis(long millis)
Constructs a
Timestamp from milliseconds since UNIX epoch. |
@NonNull long |
getMicroseconds() |
@NonNull java.time.Instant |
getValue()
This is an alias for
toInstant() |
int |
hashCode() |
java.time.Instant |
toInstant() |
ValueOuterClass.Value |
toProto() |
java.lang.String |
toString() |
public Timestamp(long value)
Timestamp
from a microsecond value.value
- The number of microseconds since UNIX epoch.public static @NonNull Timestamp fromMillis(long millis)
Timestamp
from milliseconds since UNIX epoch.millis
- milliseconds since UNIX epoch.public static @NonNull Timestamp fromInstant(@NonNull java.time.Instant instant)
Timestamp
value from an Instant
up to microsecond precision.
This is a lossy conversion as nanoseconds are not preserved.public @NonNull java.time.Instant getValue()
toInstant()
public @NonNull long getMicroseconds()
public java.time.Instant toInstant()
Instant
.public ValueOuterClass.Value toProto()
public java.lang.String toString()
toString
in class java.lang.Object
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object