public class Properties extends Object
Properties that provides methods
that interpret properties based on the type of the default value.| Constructor and Description |
|---|
Properties()
Creates a new
Properties object from the system provided
properties. |
Properties(Properties props)
Creates a new
Properties object from the provided properties. |
| Modifier and Type | Method and Description |
|---|---|
String |
getProperty(String propName)
Returns the string property associated with
propName |
double |
getProperty(String propName,
double defaultValue)
Returns the double value of the property associated with
propName,
or defaultValue if there is no property. |
int |
getProperty(String propName,
int defaultValue)
Returns the integer value of the property associated with
propName,
or defaultValue if there is no property. |
String |
getProperty(String propName,
String defaultValue)
Returns the string property associated with
propName, or defaultValue if there is no property. |
<T> T |
getProperty(String propName,
T defaultValue)
Returns a class instance of the property associated with
propName,
or defaultValue if there is no property. |
public Properties()
Properties object from the system provided
properties.public Properties(Properties props)
Properties object from the provided properties.public String getProperty(String propName)
propNamepublic String getProperty(String propName, String defaultValue)
propName, or defaultValue if there is no property.public int getProperty(String propName, int defaultValue)
propName,
or defaultValue if there is no property.public double getProperty(String propName, double defaultValue)
propName,
or defaultValue if there is no property.public <T> T getProperty(String propName, T defaultValue)
propName,
or defaultValue if there is no property. This method assumes that
the class has a no argument constructor.Copyright © 2012. All Rights Reserved.