Package org.pkl.core
Enum DurationUnit
- java.lang.Object
-
- java.lang.Enum<DurationUnit>
-
- org.pkl.core.DurationUnit
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Comparable<DurationUnit>
public enum DurationUnit extends java.lang.Enum<DurationUnit>
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description longgetNanos()Returns the conversion factor from this unit to nanoseconds.java.lang.StringgetSymbol()Returns the string symbol of this unit.static @Nullable DurationUnitparse(java.lang.String symbol)Returns the unit with the given symbol, ornullif no unit with the given symbol exists.java.time.temporal.ChronoUnittoChronoUnit()Converts this unit to aChronoUnit.java.lang.StringtoString()java.util.concurrent.TimeUnittoTimeUnit()Converts this unit to aTimeUnit.static DurationUnitvalueOf(java.lang.String name)Returns the enum constant of this type with the specified name.static DurationUnit[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
NANOS
public static final DurationUnit NANOS
-
MICROS
public static final DurationUnit MICROS
-
MILLIS
public static final DurationUnit MILLIS
-
SECONDS
public static final DurationUnit SECONDS
-
MINUTES
public static final DurationUnit MINUTES
-
HOURS
public static final DurationUnit HOURS
-
DAYS
public static final DurationUnit DAYS
-
-
Method Detail
-
values
public static DurationUnit[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (DurationUnit c : DurationUnit.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static DurationUnit valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
java.lang.IllegalArgumentException- if this enum type has no constant with the specified namejava.lang.NullPointerException- if the argument is null
-
parse
public static @Nullable DurationUnit parse(java.lang.String symbol)
Returns the unit with the given symbol, ornullif no unit with the given symbol exists.
-
getSymbol
public java.lang.String getSymbol()
Returns the string symbol of this unit.
-
getNanos
public long getNanos()
Returns the conversion factor from this unit to nanoseconds.
-
toChronoUnit
public java.time.temporal.ChronoUnit toChronoUnit()
Converts this unit to aChronoUnit.
-
toTimeUnit
public java.util.concurrent.TimeUnit toTimeUnit()
Converts this unit to aTimeUnit.
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Enum<DurationUnit>
-
-