com.Ostermiller.util
Class NameValuePair

java.lang.Object
  extended by com.Ostermiller.util.NameValuePair

public class NameValuePair
extends java.lang.Object

Represents a name value pair as would be used as a CGI parameter.

More information about this class is available from ostermiller.org.

Since:
ostermillerutils 1.03.00

Constructor Summary
NameValuePair(java.lang.String name, java.lang.String value)
          Construct a name value pair.
 
Method Summary
 java.lang.String getName()
          Get the name of the pair.
 java.lang.String getValue()
          Get the value of the pair.
 java.lang.String toString()
          Get the name and value as CGI parameters, URL Encoded to UTF-8.
 java.lang.String toString(java.lang.String charset)
          Get the name and value as CGI parameters, URL Encoded to the given encoding.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

NameValuePair

public NameValuePair(java.lang.String name,
                     java.lang.String value)
Construct a name value pair.

Parameters:
name - name of the pair.
value - value of the pair.
Since:
ostermillerutils 1.03.00
Method Detail

getName

public java.lang.String getName()
Get the name of the pair.

Returns:
the name of the pair.
Since:
ostermillerutils 1.03.00

getValue

public java.lang.String getValue()
Get the value of the pair.

Returns:
the value of the pair.
Since:
ostermillerutils 1.03.00

toString

public java.lang.String toString()
Get the name and value as CGI parameters, URL Encoded to UTF-8.

Overrides:
toString in class java.lang.Object
Returns:
CGI appropriate representation of the pair.
Since:
ostermillerutils 1.03.00

toString

public java.lang.String toString(java.lang.String charset)
                          throws java.io.UnsupportedEncodingException
Get the name and value as CGI parameters, URL Encoded to the given encoding.

Parameters:
charset - Character set to use when URL Encoding.
Returns:
CGI appropriate representation of the pair.
Throws:
java.io.UnsupportedEncodingException - if the given character set is not supported
Since:
ostermillerutils 1.03.00