|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.unitils.util.PropertyUtils
public class PropertyUtils
Utilities for working with property files.
| Constructor Summary | |
|---|---|
PropertyUtils()
|
|
| Method Summary | ||
|---|---|---|
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
|
getInstance(String propertyName,
Properties properties)
Gets an instance of the type specified by the property with the given name. |
|
static
|
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. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public PropertyUtils()
| Method Detail |
|---|
public static String getString(String propertyName,
Properties properties)
propertyName - The name, not nullproperties - The properties, not null
public static String getString(String propertyName,
String defaultValue,
Properties properties)
propertyName - The name, not nulldefaultValue - The default valueproperties - The properties, not null
public static List<String> getStringList(String propertyName,
Properties properties)
propertyName - The name, not nullproperties - The properties, not null
public 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 empty
public static boolean getBoolean(String propertyName,
Properties properties)
propertyName - The name, not nullproperties - The properties, not null
public static boolean getBoolean(String propertyName,
boolean defaultValue,
Properties properties)
propertyName - The name, not nulldefaultValue - The default valueproperties - The properties, not null
public static long getLong(String propertyName,
Properties properties)
propertyName - The name, not nullproperties - The properties, not null
public static long getLong(String propertyName,
long defaultValue,
Properties properties)
propertyName - The name, not nulldefaultValue - The default valueproperties - The properties, not null
public static int getInt(String propertyName,
Properties properties)
propertyName - The name, not nullproperties - The properties, not null
public static int getInt(String propertyName,
int defaultValue,
Properties properties)
propertyName - The name, not nulldefaultValue - The default valueproperties - The properties, not null
public static boolean containsProperty(String propertyName,
Properties properties)
propertyName - The property name, not nullproperties - The properties if not found in System, not null
public static <T> T getInstance(String propertyName,
Properties properties)
propertyName - The name, not nullproperties - The properties, not null
public static <T> T getInstance(String propertyName,
T defaultValue,
Properties properties)
propertyName - The name, not nulldefaultValue - The default valueproperties - The properties, not null
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||