|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.unitils.core.config.UnitilsConfiguration
public class UnitilsConfiguration
| Constructor Summary | |
|---|---|
UnitilsConfiguration(Properties properties)
Creates a configuration for the given properties. |
|
| Method Summary | ||
|---|---|---|
boolean |
containsProperty(String propertyName)
|
|
boolean |
getBoolean(String propertyName)
Gets the boolean value for the property with the given name. |
|
boolean |
getBoolean(String propertyName,
boolean defaultValue)
Gets the boolean value for the property with the given name. |
|
|
getInstance(String propertyName)
Gets an instance of the class name specified by the property with the given name. |
|
|
getInstance(String propertyName,
T defaultValue)
Gets an instance of the class name specified by the property with the given name. |
|
|
getInstanceOf(Class<T> type,
String... discriminators)
Gets an instance of the given type (typically an interface). |
|
int |
getInt(String propertyName)
Gets the int value for the property with the given name. |
|
int |
getInt(String propertyName,
int defaultValue)
Gets the int value for the property with the given name. |
|
long |
getLong(String propertyName)
Gets the long value for the property with the given name. |
|
long |
getLong(String propertyName,
long defaultValue)
Gets the long value for the property with the given name. |
|
Properties |
getProperties()
|
|
String |
getString(String propertyName)
Gets the string value for the property with the given name. |
|
String |
getString(String propertyName,
String defaultValue)
Gets the string value for the property with the given name. |
|
List<String> |
getStringList(String propertyName)
Gets the list of comma separated string values for the property with the given name. |
|
List<String> |
getStringList(String propertyName,
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 UnitilsConfiguration(Properties properties)
properties - All configuration properties, not null| Method Detail |
|---|
public String getString(String propertyName)
propertyName - The name, not null
public String getString(String propertyName,
String defaultValue)
propertyName - The name, not nulldefaultValue - The default value
public List<String> getStringList(String propertyName)
propertyName - The name, not null
public List<String> getStringList(String propertyName,
boolean required)
propertyName - The name, not nullrequired - If true an exception will be raised when the property is not found or empty
public boolean getBoolean(String propertyName)
propertyName - The name, not null
public boolean getBoolean(String propertyName,
boolean defaultValue)
propertyName - The name, not nulldefaultValue - The default value
public long getLong(String propertyName)
propertyName - The name, not null
public long getLong(String propertyName,
long defaultValue)
propertyName - The name, not nulldefaultValue - The default value
public int getInt(String propertyName)
propertyName - The name, not null
public int getInt(String propertyName,
int defaultValue)
propertyName - The name, not nulldefaultValue - The default value
public <T> T getInstance(String propertyName)
Configurable, the init method will be called.
propertyName - The name, not null
public <T> T getInstance(String propertyName,
T defaultValue)
Configurable, the init method will be called.
propertyName - The name, not nulldefaultValue - The default value
public <T> T getInstanceOf(Class<T> type,
String... discriminators)
Configurable, the init method will be called.
type - The type of the instancediscriminators - Optional. The values that define which specific implementation class should be used.
public boolean containsProperty(String propertyName)
propertyName - The property name, not null
public Properties getProperties()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||