com.Ostermiller.util Java Utilities


com.Ostermiller.util
Class NameValuePair

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

public class NameValuePair
extends 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
Author:
Stephen Ostermiller http://ostermiller.org/contact.pl?regarding=Java+Utilities

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

Constructor Detail

NameValuePair

public NameValuePair(String name,
                     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 String getName()
Get the name of the pair.

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

getValue

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

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

toString

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

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

toString

public String toString(String charset)
                throws 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:
UnsupportedEncodingException - if the given character set is not supported
Since:
ostermillerutils 1.03.00

com.Ostermiller.util Java Utilities


Copyright © 2001-2012 by Stephen Ostermiller