public class PropertiesUtil extends Object
| Modifier and Type | Method and Description |
|---|---|
static boolean |
getBoolean(Properties properties,
String property)
Parses the (string) value of a property and determines whether it is true
|
static <T extends Enum<T>> |
getEnum(Properties properties,
String property,
Class<T> enumClass)
Parses the (string) value of a property and determines its enum value
|
static int |
getIntOrDefault(Properties properties,
String property,
int defaultInt)
Parses the (string) value of a property and determines its integer value
|
static String |
getString(Properties properties,
String property)
Parses the (string) value of a property and determines its string value
|
static Properties |
loadProperties(String propertiesFile)
Loads Java Properties from a file on the class path
|
public static Properties loadProperties(String propertiesFile)
propertiesFile - File namepublic static boolean getBoolean(Properties properties, String property)
properties - The properties to searchproperty - The property to evaluatepublic static int getIntOrDefault(Properties properties, String property, int defaultInt)
properties - The properties to searchproperty - The property to evaluatedefaultInt - The default if the property is missingpublic static String getString(Properties properties, String property)
properties - The properties to searchproperty - The property to evaluatepublic static <T extends Enum<T>> T getEnum(Properties properties, String property, Class<T> enumClass)
T - An enum typeproperties - The properties to searchproperty - The property to evaluateenumClass - The class of enum to returnCopyright © 2010–2017 oshi. All rights reserved.