Package com.couchbase.client.core.util
Class NanoTimestamp
java.lang.Object
com.couchbase.client.core.util.NanoTimestamp
- All Implemented Interfaces:
Comparable<NanoTimestamp>
-
Method Summary
Modifier and TypeMethodDescriptionint
elapsed()
Returns the time elapsed since this timestamp was created.boolean
boolean
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 bynever()
, otherwise false.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.toString()
-
Method Details
-
now
Returns a timestamp representing the current time. -
never
Returns a timestamp from ~146 years ago, for representing the time of events that have not occurred.- See Also:
-
isNever
public boolean isNever()Returns true if this timestamp was created bynever()
, otherwise false. -
compareTo
- Specified by:
compareTo
in interfaceComparable<NanoTimestamp>
-
elapsed
Returns the time elapsed since this timestamp was created.NOTE: If this timestamp is
never()
, the returned value will be at least 146 years.- See Also:
-
hasElapsed
Returns true if the time elapsed since this timestamp was created is greater than or equal to the given duration, otherwise false.If this timestamp is
never()
, this method returns true for all "reasonable" durations (less than ~146 years). -
minus
-
toString
-
equals
-
hashCode
public int hashCode()
-