public enum TimeResolution extends Enum<TimeResolution>
| Enum Constant and Description |
|---|
HIGH_RES
2-30 seconds precision.
|
SECONDS
second precision.
|
| Modifier and Type | Method and Description |
|---|---|
static Date |
toDate(long timestamp,
TimeResolution resolution)
|
static Date |
toDate(TimeSpan timestamp)
Converts to
Date the given timestamp. |
static long |
toMillis(long val,
TimeResolution resolution)
|
static long |
toMillis(TimeSpan timeSpan)
Converts to milliseconds the given
timeSpan. |
static TimeResolution |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static TimeResolution[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final TimeResolution SECONDS
public static final TimeResolution HIGH_RES
public static TimeResolution[] values()
for (TimeResolution c : TimeResolution.values()) System.out.println(c);
public static TimeResolution 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 static long toMillis(TimeSpan timeSpan)
timeSpan.timeSpan - time duration to convertpublic static long toMillis(long val,
TimeResolution resolution)
val - the durationresolution - the precisionpublic static Date toDate(TimeSpan timestamp)
Date the given timestamp.timestamp - time duration since epochDate corresponding to the given timestamppublic static Date toDate(long timestamp, TimeResolution resolution)
timestamp - time duration since epochresolution - the timestamp precisionDate corresponding to the given timestampCopyright © 2014–2017 Red Hat, Inc.. All rights reserved.