public enum TimeValueConfig extends Enum<TimeValueConfig>
Modifier and Type | Field and Description |
---|---|
static Set<TimeValueConfig> |
VALUES |
Modifier and Type | Method and Description |
---|---|
static long |
durationOf(Map<TimeValueConfig,? extends Number> spec) |
static long |
durationOf(String s) |
static TimeValueConfig |
fromValueChar(char ch) |
long |
getInterval() |
char |
getLowerCaseValue() |
char |
getUpperCaseValue() |
static Map<TimeValueConfig,Long> |
parse(String s) |
static TimeValueConfig |
valueOf(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 Set<TimeValueConfig> VALUES
public static TimeValueConfig[] values()
for (TimeValueConfig c : TimeValueConfig.values()) System.out.println(c);
public static TimeValueConfig 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 final char getLowerCaseValue()
public final char getUpperCaseValue()
public final long getInterval()
public static TimeValueConfig fromValueChar(char ch)
public static long durationOf(String s)
s
- A time specificationparse(String)
,
durationOf(Map)
public static Map<TimeValueConfig,Long> parse(String s) throws NumberFormatException, 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 countNumberFormatException
- If bad numbers found - e.g., negative countsIllegalArgumentException
- If bad format - e.g., unknown unitpublic static long durationOf(Map<TimeValueConfig,? extends Number> spec) throws IllegalArgumentException
spec
- The Map
specifying the count for each TimeValueConfig
IllegalArgumentException
- If negative count for a time unitCopyright © 2008–2016 The Apache Software Foundation. All rights reserved.