public class ParameterParser extends Object
Constructor and Description |
---|
ParameterParser() |
Modifier and Type | Method and Description |
---|---|
static Long |
asMilliSeconds(Object value,
Long defaultValue)
Tries to return the given object as a Long.
|
private static int |
findUnitOffset(String time) |
private static Long |
parseTime(String time) |
private static double |
parseUnit(String unit) |
public static Long asMilliSeconds(Object value, Long defaultValue)
value
- some representation of a number of secondsdefaultValue
- returned if value is nullNumberFormatException
- if value is not a Number instance and its String
representation cannot be parsed as a number followed
optionally by time unitprivate static Long parseTime(String time) throws NumberFormatException
NumberFormatException
private static int findUnitOffset(String time)
private static double parseUnit(String unit)
Copyright © 2018. All rights reserved.