|
Version: ${maven.project.version} | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.util.Dictionary<K,V> java.util.Hashtable<java.lang.String,java.lang.Object> org.soaplab.services.metadata.PropertiesBag
public class PropertiesBag
A simple extension of java.util.Hashtable bringing more methods for checking and retrieving properties. It is also the place where we can later add case-insensitive handling of keys.
Constructor Summary | |
---|---|
PropertiesBag()
An empty constructor. |
|
PropertiesBag(java.lang.String[] props)
Create a bag initialized with 'props'. |
|
PropertiesBag(java.lang.String propName,
java.lang.String propValue)
A convenient constructor for creating a bag with exactly one property. |
Method Summary | |
---|---|
void |
addProperties(PropertiesBag options)
Add new properties to this bag. |
boolean |
exists(java.lang.String key)
Returns true if an option defined by a 'key' is present and has a non-empty value. |
java.lang.String |
format(int indent)
As toString() but with indentations. |
boolean |
found(java.lang.String key,
java.lang.String value)
Returns true if an option indicated by 'key' is found within this bag AND is equal to a given value. |
int |
getInt(java.lang.String key)
Return an integer value of the option indicated by 'key'. |
java.lang.String |
getStr(java.lang.String key)
Return a string value of the option indicated by 'key'. |
boolean |
is(java.lang.String key)
Returns true if an option defined by a 'key' is present and has a true value. |
boolean |
is(java.lang.String key,
int serNo)
Returns true if an option defined by a 'key' is present and has a true value. |
Methods inherited from class java.util.Hashtable |
---|
clear, clone, contains, containsKey, containsValue, elements, entrySet, equals, get, hashCode, isEmpty, keys, keySet, put, putAll, remove, size, toString, values |
Methods inherited from class java.lang.Object |
---|
getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public PropertiesBag()
public PropertiesBag(java.lang.String[] props)
public PropertiesBag(java.lang.String propName, java.lang.String propValue)
Method Detail |
---|
public void addProperties(PropertiesBag options)
public boolean is(java.lang.String key)
public boolean is(java.lang.String key, int serNo)
For example, you can look for 'debug1' by calling is ('debug', 1).
public boolean exists(java.lang.String key)
public boolean found(java.lang.String key, java.lang.String value)
public java.lang.String getStr(java.lang.String key)
public int getInt(java.lang.String key)
public java.lang.String format(int indent)
|
Version: ${maven.project.version} | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |