org.apache.pluto.portalImpl.util
Class NameValuePairs
java.lang.Object
org.apache.pluto.portalImpl.util.NameValuePairs
- Direct Known Subclasses:
- Parameters, Properties
public abstract class NameValuePairs
- extends java.lang.Object
This class collects name/value pairs and provides
convenient methods to access them as different types.
- See Also:
Properties
,
Parameters
Method Summary |
protected void |
add(java.lang.String aName,
java.lang.String aValue)
|
protected void |
add(java.lang.String aName,
java.lang.String[] aValues)
|
protected NameValuePairs.Entry |
findEntry(java.lang.String aName)
|
private java.lang.String |
findString(java.lang.String aName)
|
java.lang.Boolean |
getBoolean(java.lang.String aName)
|
boolean |
getBoolean(java.lang.String aName,
boolean aDefault)
|
java.lang.Boolean |
getBoolean(java.lang.String aName,
java.lang.Boolean aDefault)
|
(package private) java.util.List |
getEntries()
|
java.lang.Integer |
getInteger(java.lang.String aName)
|
int |
getInteger(java.lang.String aName,
int aDefault)
|
java.lang.Integer |
getInteger(java.lang.String aName,
java.lang.Integer aDefault)
|
(package private) NameValuePairs |
getParent()
|
java.lang.String |
getString(java.lang.String aName)
Returns the value for the given name as string,
or null if there is no pair with the given name. |
java.lang.String |
getString(java.lang.String aName,
java.lang.String aDefault)
Returns the value for the given name as string,
or the given default if there is no pair with the given name. |
java.lang.String[] |
getStrings(java.lang.String aName)
Returns all values for the given name as a string array,
or null if there is no pair with the given name. |
java.util.Iterator |
keys()
|
java.util.Iterator |
names()
|
protected void |
removeEntry(java.lang.String aName)
|
void |
setParent(NameValuePairs aParent)
|
int |
size()
Returns the number of name/value pairs. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
iParent
private NameValuePairs iParent
iEntries
private java.util.List iEntries
NameValuePairs
protected NameValuePairs()
size
public int size()
- Returns the number of name/value pairs. Names
that have more than one value are counted as one name.
- Returns:
- the number of name/value pairs
getString
public java.lang.String getString(java.lang.String aName)
- Returns the value for the given name as string,
or
null
if there is no pair with the given name.
- Parameters:
aName
- the name of a pair
- Returns:
- the value of the pair
getString
public java.lang.String getString(java.lang.String aName,
java.lang.String aDefault)
- Returns the value for the given name as string,
or the given default if there is no pair with the given name.
- Parameters:
aName
- the name of a pairaDefault
- the default value
- Returns:
- the value of the pair
getStrings
public java.lang.String[] getStrings(java.lang.String aName)
- Returns all values for the given name as a string array,
or
null
if there is no pair with the given name.
- Parameters:
aName
- the name of a pair
- Returns:
- the values of the pair
getInteger
public java.lang.Integer getInteger(java.lang.String aName)
getInteger
public java.lang.Integer getInteger(java.lang.String aName,
java.lang.Integer aDefault)
getInteger
public int getInteger(java.lang.String aName,
int aDefault)
getBoolean
public java.lang.Boolean getBoolean(java.lang.String aName)
getBoolean
public java.lang.Boolean getBoolean(java.lang.String aName,
java.lang.Boolean aDefault)
getBoolean
public boolean getBoolean(java.lang.String aName,
boolean aDefault)
names
public java.util.Iterator names()
keys
public final java.util.Iterator keys()
setParent
public void setParent(NameValuePairs aParent)
toString
public java.lang.String toString()
- Overrides:
toString
in class java.lang.Object
add
protected void add(java.lang.String aName,
java.lang.String aValue)
add
protected void add(java.lang.String aName,
java.lang.String[] aValues)
findEntry
protected NameValuePairs.Entry findEntry(java.lang.String aName)
removeEntry
protected void removeEntry(java.lang.String aName)
findString
private java.lang.String findString(java.lang.String aName)
getParent
NameValuePairs getParent()
getEntries
java.util.List getEntries()