public class TypedProperties
extends java.lang.Object
Example:
| Constructor and Description |
|---|
TypedProperties(java.util.Properties properties,
java.lang.String namespace)
Creates a new instance of the TypedProperties class.
|
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
get(Property<java.lang.String> property)
Gets the value of a String property.
|
boolean |
getBoolean(Property<java.lang.Boolean> property)
Gets the value of a boolean property.
|
<T extends java.lang.Enum<T>> |
getEnum(Property<T> property,
java.lang.Class<T> enumClass)
Gets the value of an Enumeration property.
|
int |
getInt(Property<java.lang.Integer> property)
Gets the value of an Integer property.
|
long |
getLong(Property<java.lang.Long> property)
Gets the value of a Long property.
|
public TypedProperties(java.util.Properties properties,
java.lang.String namespace)
properties - The java.util.Properties to wrap.namespace - The namespace of this instance.public java.lang.String get(Property<java.lang.String> property) throws ConfigurationException
property - The Property to get.ConfigurationException - When the given property name does not exist within the current component and the property
does not have a default value set.public int getInt(Property<java.lang.Integer> property) throws ConfigurationException
property - The Property to get.ConfigurationException - When the given property name does not exist within the current component and the property
does not have a default value set, or when the property cannot be parsed as an Integer.public long getLong(Property<java.lang.Long> property) throws ConfigurationException
property - The Property to get.ConfigurationException - When the given property name does not exist within the current component and the property
does not have a default value set, or when the property cannot be parsed as a Long.public <T extends java.lang.Enum<T>> T getEnum(Property<T> property, java.lang.Class<T> enumClass) throws ConfigurationException
T - Type of Enumeration.property - The Property to get.enumClass - Class defining return type.ConfigurationException - When the given property name does not exist within the current component and the property
does not have a default value set, or when the property cannot be parsed as the given Enum.public boolean getBoolean(Property<java.lang.Boolean> property) throws ConfigurationException
property - The Property to get.ConfigurationException - When the given property name does not exist within the current component and the property
does not have a default value set, or when the property cannot be parsed as a Boolean.