@Stability.Internal public class NanoTimestamp extends Object implements Comparable<NanoTimestamp>
| Modifier and Type | Method and Description |
|---|---|
int |
compareTo(NanoTimestamp o) |
Duration |
elapsed()
Returns the time elapsed since this timestamp was created.
|
boolean |
equals(Object o) |
boolean |
hasElapsed(Duration d)
Returns true if the time elapsed since this timestamp was created is
greater than or equal to the given duration, otherwise false.
|
int |
hashCode() |
boolean |
isNever()
Returns true if this timestamp was created by
never(), otherwise false. |
Duration |
minus(NanoTimestamp rhs) |
static NanoTimestamp |
never()
Returns a timestamp from ~146 years ago, for representing
the time of events that have not occurred.
|
static NanoTimestamp |
now()
Returns a timestamp representing the current time.
|
String |
toString() |
public static NanoTimestamp now()
public static NanoTimestamp never()
isNever()public boolean isNever()
never(), otherwise false.public int compareTo(NanoTimestamp o)
compareTo in interface Comparable<NanoTimestamp>public Duration elapsed()
NOTE: If this timestamp is never(), the returned value
will be at least 146 years.
isNever()public boolean hasElapsed(Duration d)
If this timestamp is never(), this method returns true for
all "reasonable" durations (less than ~146 years).
public Duration minus(NanoTimestamp rhs)
Copyright © 2024 Couchbase, Inc.. All rights reserved.