Class Clock.FixedClock
- java.lang.Object
-
- org.threeten.bp.Clock
-
- org.threeten.bp.Clock.FixedClock
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.threeten.bp.Clock
Clock.FixedClock, Clock.OffsetClock, Clock.SystemClock, Clock.TickClock
-
-
Field Summary
Fields Modifier and Type Field Description private Instantinstantprivate static longserialVersionUIDprivate ZoneIdzone
-
Constructor Summary
Constructors Constructor Description FixedClock(Instant fixedInstant, ZoneId zone)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object obj)Checks if this clock is equal to another clock.ZoneIdgetZone()Gets the time-zone being used to create dates and times.inthashCode()A hash code for this clock.Instantinstant()Gets the current instant of the clock.longmillis()Gets the current millisecond instant of the clock.java.lang.StringtoString()ClockwithZone(ZoneId zone)Returns a copy of this clock with a different time-zone.-
Methods inherited from class org.threeten.bp.Clock
fixed, offset, system, systemDefaultZone, systemUTC, tick, tickMinutes, tickSeconds
-
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
-
instant
private final Instant instant
-
zone
private final ZoneId zone
-
-
Method Detail
-
getZone
public ZoneId getZone()
Description copied from class:ClockGets the time-zone being used to create dates and times.A clock will typically obtain the current instant and then convert that to a date or time using a time-zone. This method returns the time-zone used.
-
withZone
public Clock withZone(ZoneId zone)
Description copied from class:ClockReturns a copy of this clock with a different time-zone.A clock will typically obtain the current instant and then convert that to a date or time using a time-zone. This method returns a clock with similar properties but using a different time-zone.
-
millis
public long millis()
Description copied from class:ClockGets the current millisecond instant of the clock.This returns the millisecond-based instant, measured from 1970-01-01T00:00 UTC. This is equivalent to the definition of
System.currentTimeMillis().Most applications should avoid this method and use
Instantto represent an instant on the time-line rather than a raw millisecond value. This method is provided to allow the use of the clock in high performance use cases where the creation of an object would be unacceptable. The default implementation currently callsClock.instant().
-
instant
public Instant instant()
Description copied from class:ClockGets the current instant of the clock.This returns an instant representing the current instant as defined by the clock.
-
equals
public boolean equals(java.lang.Object obj)
Description copied from class:ClockChecks if this clock is equal to another clock.Clocks must compare equal based on their state and behavior.
-
hashCode
public int hashCode()
Description copied from class:ClockA hash code for this clock.
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-