public class PropertyUtils extends Object
| Constructor and Description |
|---|
PropertyUtils() |
| Modifier and Type | Method and Description |
|---|---|
static boolean |
containsProperty(String propertyName,
Properties properties)
Checks whether the property with the given name exists in the System or in the given properties.
|
static boolean |
getBoolean(String propertyName,
boolean defaultValue,
Properties properties)
Gets the boolean value for the property with the given name.
|
static boolean |
getBoolean(String propertyName,
Properties properties)
Gets the boolean value for the property with the given name.
|
static <T> T |
getInstance(String propertyName,
Properties properties)
Gets an instance of the type specified by the property with the given name.
|
static <T> T |
getInstance(String propertyName,
T defaultValue,
Properties properties)
Gets an instance of the type specified by the property with the given name.
|
static int |
getInt(String propertyName,
int defaultValue,
Properties properties)
Gets the int value for the property with the given name.
|
static int |
getInt(String propertyName,
Properties properties)
Gets the int value for the property with the given name.
|
static long |
getLong(String propertyName,
long defaultValue,
Properties properties)
Gets the long value for the property with the given name.
|
static long |
getLong(String propertyName,
Properties properties)
Gets the long value for the property with the given name.
|
static String |
getString(String propertyName,
Properties properties)
Gets the string value for the property with the given name.
|
static String |
getString(String propertyName,
String defaultValue,
Properties properties)
Gets the string value for the property with the given name.
|
static List<String> |
getStringList(String propertyName,
Properties properties)
Gets the list of comma separated string values for the property with the given name.
|
static List<String> |
getStringList(String propertyName,
Properties properties,
boolean required)
Gets the list of comma separated string values for the property with the given name.
|
public static String getString(String propertyName, Properties properties)
propertyName - The name, not nullproperties - The properties, not nullpublic static String getString(String propertyName, String defaultValue, Properties properties)
propertyName - The name, not nulldefaultValue - The default valueproperties - The properties, not nullpublic static List<String> getStringList(String propertyName, Properties properties)
propertyName - The name, not nullproperties - The properties, not nullpublic static List<String> getStringList(String propertyName, Properties properties, boolean required)
propertyName - The name, not nullproperties - The properties, not nullrequired - If true an exception will be raised when the property is not found or emptypublic static boolean getBoolean(String propertyName, Properties properties)
propertyName - The name, not nullproperties - The properties, not nullpublic static boolean getBoolean(String propertyName, boolean defaultValue, Properties properties)
propertyName - The name, not nulldefaultValue - The default valueproperties - The properties, not nullpublic static long getLong(String propertyName, Properties properties)
propertyName - The name, not nullproperties - The properties, not nullpublic static long getLong(String propertyName, long defaultValue, Properties properties)
propertyName - The name, not nulldefaultValue - The default valueproperties - The properties, not nullpublic static int getInt(String propertyName, Properties properties)
propertyName - The name, not nullproperties - The properties, not nullpublic static int getInt(String propertyName, int defaultValue, Properties properties)
propertyName - The name, not nulldefaultValue - The default valueproperties - The properties, not nullpublic static boolean containsProperty(String propertyName, Properties properties)
propertyName - The property name, not nullproperties - The properties if not found in System, not nullpublic static <T> T getInstance(String propertyName, Properties properties)
propertyName - The name, not nullproperties - The properties, not nullpublic static <T> T getInstance(String propertyName, T defaultValue, Properties properties)
propertyName - The name, not nulldefaultValue - The default valueproperties - The properties, not nullCopyright © 2016. All Rights Reserved.