public abstract class Utilities extends Object
Constructor and Description |
---|
Utilities() |
Modifier and Type | Method and Description |
---|---|
static boolean |
get(Properties properties,
String name,
boolean defaultValue)
Extracts the named property from the given set of properties.
|
static int |
get(Properties properties,
String name,
int defaultValue)
Extracts the named property from the given set of properties.
|
static boolean |
isOn(String value)
Translates the given string value into a boolean.
|
static Date |
parse(DateFormat format,
String string)
Parses the given string value into a
Date instance. |
static Number |
parse(NumberFormat format,
String string)
Parses the given string value into a
Number instance. |
public static boolean isOn(String value)
value
- String value that should be one of the following: true,
false, on, off, yes and no.public static Number parse(NumberFormat format, String string)
Number
instance.format
- Number format to use for the parsing.string
- String value that should be parsed.Number
that was parsed or null if parsing failed or if
the string itself was null.public static Date parse(DateFormat format, String string)
Date
instance.format
- Date format to use for the parsing.string
- String value that should be parsed.Date
that was parsed or null if parsing failed or if
the string itself was null.public static int get(Properties properties, String name, int defaultValue)
properties
- Date format to use for the parsing.name
- Name of the property.defaultValue
- Default integer value to return if the named
property is not found in the set of properties.public static boolean get(Properties properties, String name, boolean defaultValue)
properties
- Date format to use for the parsing.name
- Name of the property.defaultValue
- Default boolean value to return if the named
property is not found in the set of properties.Copyright © 2016. All Rights Reserved.