com.netscape.certsrv.common
Class NameValuePairs

java.lang.Object
  extended by com.netscape.certsrv.common.NameValuePairs

public class NameValuePairs
extends java.lang.Object

A class represents an ordered list of name value pairs.

Version:
$Revision: 1211 $, $Date: 2010-08-18 10:15:37 -0700 (Wed, 18 Aug 2010) $

Constructor Summary
NameValuePairs()
          Constructs name value pairs.
 
Method Summary
 void add(java.lang.String name, java.lang.String value)
          Adds a name value pair into this set.
 NameValuePair elementAt(int pos)
          Retrieves name value pairs in specific position.
 java.util.Enumeration elements()
          Returns a list of name value pair object.
 java.util.Enumeration getNames()
          Retrieves a list of names.
 NameValuePair getPair(java.lang.String name)
          Retrieves name value pair from this set.
 java.lang.String getValue(java.lang.String name)
          Retrieves value of the name value pairs that matches the given name.
static boolean parseInto(java.lang.String s, NameValuePairs nvp)
          Parses a string into name value pairs.
 void removeAllPairs()
          Removes all name value pairs in this set.
 int size()
          Returns number of pairs in this set.
 java.lang.String toString()
          Show the content of this name value container as string representation.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

NameValuePairs

public NameValuePairs()
Constructs name value pairs.

Method Detail

add

public void add(java.lang.String name,
                java.lang.String value)
Adds a name value pair into this set. if the name already exist, the value will be replaced.

Parameters:
name - name
value - value

getPair

public NameValuePair getPair(java.lang.String name)
Retrieves name value pair from this set.

Parameters:
name - name
Returns:
name value pair

size

public int size()
Returns number of pairs in this set.

Returns:
size

elementAt

public NameValuePair elementAt(int pos)
Retrieves name value pairs in specific position.

Parameters:
pos - position of the value
Returns:
name value pair

removeAllPairs

public void removeAllPairs()
Removes all name value pairs in this set.


getValue

public java.lang.String getValue(java.lang.String name)
Retrieves value of the name value pairs that matches the given name.

Parameters:
name - name
Returns:
value

getNames

public java.util.Enumeration getNames()
Retrieves a list of names.

Returns:
a list of names

toString

public java.lang.String toString()
Show the content of this name value container as string representation.

Overrides:
toString in class java.lang.Object
Returns:
string representation

parseInto

public static boolean parseInto(java.lang.String s,
                                NameValuePairs nvp)
Parses a string into name value pairs.

Parameters:
s - string
nvp - name value pairs
Returns:
true if successful

elements

public java.util.Enumeration elements()
Returns a list of name value pair object.

Returns:
name value objects