public final class PropertiesI extends java.lang.Object implements Properties
serialVersionUID| Modifier and Type | Method and Description |
|---|---|
Properties |
_clone()
Create a copy of this property set.
|
java.lang.String[] |
getCommandLineOptions()
Get a sequence of command-line options that is equivalent to
this property set.
|
java.util.Map<java.lang.String,java.lang.String> |
getPropertiesForPrefix(java.lang.String prefix)
Get all properties whose keys begins with
prefix.
|
java.lang.String |
getProperty(java.lang.String key)
Get a property by key.
|
int |
getPropertyAsInt(java.lang.String key)
Get a property as an integer.
|
int |
getPropertyAsIntWithDefault(java.lang.String key,
int value)
Get a property as an integer.
|
java.lang.String[] |
getPropertyAsList(java.lang.String key)
Get a property as a list of strings.
|
java.lang.String[] |
getPropertyAsListWithDefault(java.lang.String key,
java.lang.String[] value)
Get a property as a list of strings.
|
java.lang.String |
getPropertyWithDefault(java.lang.String key,
java.lang.String value)
Get a property by key.
|
java.util.List<java.lang.String> |
getUnusedProperties() |
void |
load(java.lang.String file)
Load properties from a file.
|
java.lang.String[] |
parseCommandLineOptions(java.lang.String pfx,
java.lang.String[] options)
Convert a sequence of command-line options into properties.
|
java.lang.String[] |
parseIceCommandLineOptions(java.lang.String[] options)
Convert a sequence of command-line options into properties.
|
void |
setProperty(java.lang.String key,
java.lang.String value)
Set a property.
|
public java.lang.String getProperty(java.lang.String key)
PropertiesgetProperty in interface Propertieskey - The property key.Properties.setProperty(java.lang.String, java.lang.String)public java.lang.String getPropertyWithDefault(java.lang.String key,
java.lang.String value)
PropertiesgetPropertyWithDefault in interface Propertieskey - The property key.value - The default value to use if the property does not
exist.Properties.setProperty(java.lang.String, java.lang.String)public int getPropertyAsInt(java.lang.String key)
PropertiesgetPropertyAsInt in interface Propertieskey - The property key.Properties.setProperty(java.lang.String, java.lang.String)public int getPropertyAsIntWithDefault(java.lang.String key,
int value)
PropertiesgetPropertyAsIntWithDefault in interface Propertieskey - The property key.value - The default value to use if the property does not
exist.Properties.setProperty(java.lang.String, java.lang.String)public java.lang.String[] getPropertyAsList(java.lang.String key)
PropertiesgetPropertyAsList in interface Propertieskey - The property key.Properties.setProperty(java.lang.String, java.lang.String)public java.lang.String[] getPropertyAsListWithDefault(java.lang.String key,
java.lang.String[] value)
PropertiesgetPropertyAsListWithDefault in interface Propertieskey - The property key.value - The default value to use if the property is not set.Properties.setProperty(java.lang.String, java.lang.String)public java.util.Map<java.lang.String,java.lang.String> getPropertiesForPrefix(java.lang.String prefix)
PropertiesgetPropertiesForPrefix in interface Propertiesprefix - The prefix to search for (empty string if none).public void setProperty(java.lang.String key,
java.lang.String value)
PropertiessetProperty in interface Propertieskey - The property key.value - The property value.Properties.getProperty(java.lang.String)public java.lang.String[] getCommandLineOptions()
PropertiesgetCommandLineOptions in interface Propertiespublic java.lang.String[] parseCommandLineOptions(java.lang.String pfx,
java.lang.String[] options)
PropertiesparseCommandLineOptions in interface Propertiespfx - The property prefix, or an empty string to
convert all options starting with --.options - The command-line options.public java.lang.String[] parseIceCommandLineOptions(java.lang.String[] options)
PropertiesparseIceCommandLineOptions in interface Propertiesoptions - The command-line options.public void load(java.lang.String file)
Propertiesload in interface Propertiesfile - The property file.public Properties _clone()
Properties_clone in interface Propertiespublic java.util.List<java.lang.String> getUnusedProperties()