public enum TimestampProviders extends Enum<TimestampProviders> implements TimestampProvider
TimestampProvider for different resolutions of time:
| Modifier and Type | Method and Description |
|---|---|
Timer |
getTimer()
Returns a
Timer based on this timestamp provider |
void |
sleepFor(java.time.Duration duration)
Sleep for the given duration of time.
|
java.time.Instant |
sleepPast(java.time.Instant futureTime)
Block until the current time as returned by
TimestampProvider.getTime() is greater
than the given timepoint. |
String |
toString() |
static TimestampProviders |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static TimestampProviders[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, valueOfgetTime, getTime, getTime, getUnitpublic static final TimestampProviders NANO
public static final TimestampProviders MICRO
public static final TimestampProviders MILLI
public static TimestampProviders[] values()
for (TimestampProviders c : TimestampProviders.values()) System.out.println(c);
public static TimestampProviders valueOf(String name)
name - the name of the enum constant to be returned.IllegalArgumentException - if this enum type has no constant with the specified nameNullPointerException - if the argument is nullpublic java.time.Instant sleepPast(java.time.Instant futureTime)
throws InterruptedException
TimestampProviderTimestampProvider.getTime() is greater
than the given timepoint.sleepPast in interface TimestampProviderfutureTime - The time to sleep pastunit argumentInterruptedException - if externally interruptedpublic void sleepFor(java.time.Duration duration)
throws InterruptedException
TimestampProvidersleepFor in interface TimestampProviderInterruptedExceptionpublic Timer getTimer()
TimestampProviderTimer based on this timestamp providergetTimer in interface TimestampProviderpublic String toString()
toString in class Enum<TimestampProviders>Copyright © 2012–2015. All rights reserved.