public enum TimeValueConfig extends java.lang.Enum<TimeValueConfig>
Modifier and Type | Field and Description |
---|---|
private char |
hiChar |
private long |
interval |
private char |
loChar |
static java.util.Set<TimeValueConfig> |
VALUES |
Modifier and Type | Method and Description |
---|---|
static long |
durationOf(java.util.Map<TimeValueConfig,? extends java.lang.Number> spec) |
static long |
durationOf(java.lang.String s) |
static TimeValueConfig |
fromValueChar(char ch) |
long |
getInterval() |
char |
getLowerCaseValue() |
char |
getUpperCaseValue() |
static java.util.Map<TimeValueConfig,java.lang.Long> |
parse(java.lang.String s) |
static TimeValueConfig |
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.
|
static TimeValueConfig[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final TimeValueConfig SECONDS
public static final TimeValueConfig MINUTES
public static final TimeValueConfig HOURS
public static final TimeValueConfig DAYS
public static final TimeValueConfig WEEKS
public static final java.util.Set<TimeValueConfig> VALUES
private final char loChar
private final char hiChar
private final long interval
public static TimeValueConfig[] values()
for (TimeValueConfig c : TimeValueConfig.values()) System.out.println(c);
public static TimeValueConfig valueOf(java.lang.String name)
name
- the name of the enum constant to be returned.java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is nullpublic final char getLowerCaseValue()
public final char getUpperCaseValue()
public final long getInterval()
public static TimeValueConfig fromValueChar(char ch)
public static long durationOf(java.lang.String s)
s
- A time specificationparse(String)
,
durationOf(Map)
public static java.util.Map<TimeValueConfig,java.lang.Long> parse(java.lang.String s) throws java.lang.IllegalArgumentException
s
- An input time specification containing possibly mixed numbers
and units - e.g., 3h10m
to indicate 3 hours and 10 minutesMap
specifying for each time unit its countjava.lang.NumberFormatException
- If bad numbers found - e.g., negative countsjava.lang.IllegalArgumentException
- If bad format - e.g., unknown unitpublic static long durationOf(java.util.Map<TimeValueConfig,? extends java.lang.Number> spec) throws java.lang.IllegalArgumentException
spec
- The Map
specifying the count for each TimeValueConfig
java.lang.IllegalArgumentException
- If negative count for a time unit