org.apache.commons.httpclient
Class NameValuePair

java.lang.Object
  |
  +--org.apache.commons.httpclient.NameValuePair
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
Cookie, Header, HeaderElement

public class NameValuePair
extends Object
implements Serializable

A simple class encapsulating a name/value pair.

Version:
$Revision: 1.14.2.1 $ $Date: 2004/02/22 18:21:13 $
Author:
B.C. Holmes, Sean C. Sullivan, Mike Bowler
See Also:
Serialized Form

Constructor Summary
NameValuePair()
          Default constructor.
NameValuePair(String name, String value)
          Constructor.
 
Method Summary
 boolean equals(Object object)
          Test if the given object is equal to me.
 String getName()
          Return the name.
 String getValue()
          Return the current value.
 int hashCode()
          hashCode.
 void setName(String name)
          Set the name.
 void setValue(String value)
          Set the value.
 String toString()
          Get a String representation of this pair.
 
Methods inherited from class java.lang.Object
, clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

NameValuePair

public NameValuePair()
Default constructor.

NameValuePair

public NameValuePair(String name,
                     String value)
Constructor.
Parameters:
name - The name.
value - The value.
Method Detail

setName

public void setName(String name)
Set the name.
Parameters:
name - The new name
See Also:
getName()

getName

public String getName()
Return the name.
Returns:
String name The name
See Also:
setName(String)

setValue

public void setValue(String value)
Set the value.
Parameters:
value - The new value.

getValue

public String getValue()
Return the current value.
Returns:
String value The current value.

toString

public String toString()
Get a String representation of this pair.
Overrides:
toString in class Object
Returns:
A string representation.

equals

public boolean equals(Object object)
Test if the given object is equal to me. In this implementation, an object is equal to me iff it has the same runtime type and the name and value attributes are both equal (or ==).
Overrides:
equals in class Object
Parameters:
object - the Object to compare to
Returns:
true if the objects are equal.

hashCode

public int hashCode()
hashCode. Returns a hash code for this object such that if a.equals(b) then a.hashCode() == b.hashCode().
Overrides:
hashCode in class Object
Returns:
The hash code.


Copyright © 2001-2004 Apache Software Foundation. All Rights Reserved.