Package io.openems.common.test
Class TimeLeapClock
java.lang.Object
java.time.Clock
io.openems.common.test.TimeLeapClock
- All Implemented Interfaces:
InstantSource
-
Constructor Summary
ConstructorDescriptionTimeLeapClock
(Instant start) TimeLeapClock
(Instant start, ZoneId zone) TimeLeapClock
(ZoneId zone) -
Method Summary
Modifier and TypeMethodDescriptionboolean
getZone()
int
hashCode()
instant()
void
leap
(long amountToAdd, TemporalUnit unit) Add a time leap to theTimeLeapClock
.long
millis()
now()
Get current DateTime asZonedDateTime
.toString()
Methods inherited from class java.time.Clock
fixed, offset, system, systemDefaultZone, systemUTC, tick, tickMillis, tickMinutes, tickSeconds
-
Constructor Details
-
TimeLeapClock
-
TimeLeapClock
-
TimeLeapClock
-
TimeLeapClock
public TimeLeapClock()
-
-
Method Details
-
withZone
- Specified by:
withZone
in interfaceInstantSource
- Specified by:
withZone
in classClock
-
getZone
-
leap
Add a time leap to theTimeLeapClock
.- Parameters:
amountToAdd
- the amount to addunit
- theTemporalUnit
-
millis
public long millis()- Specified by:
millis
in interfaceInstantSource
- Overrides:
millis
in classClock
-
instant
- Specified by:
instant
in interfaceInstantSource
- Specified by:
instant
in classClock
-
equals
-
hashCode
public int hashCode() -
toString
-
now
Get current DateTime asZonedDateTime
.- Returns:
- current date and time.
-