org.apache.commons.httpclient
Class NameValuePair

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

public class NameValuePair
extends java.lang.Object
implements java.io.Serializable

A simple class encapsulating a name/value pair.

Version:
$Revision: 1.8 $ $Date: 2002/07/28 18:08:57 $
Author:
B.C. Holmes
See Also:
Serialized Form

Constructor Summary
NameValuePair()
          Default constructor.
NameValuePair(java.lang.String name, java.lang.String value)
          Constructor.
 
Method Summary
 boolean equals(java.lang.Object object)
          Test if the given object is equal to me.
 java.lang.String getName()
          Name property getter.
 java.lang.String getValue()
          Value property getter.
 int hashCode()
          Returns a hash code for this object such that if a.equals(b) then a.hashCode() == b.hashCode().
 void setName(java.lang.String name)
          Name property setter.
 void setValue(java.lang.String value)
          Value property setter.
 java.lang.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(java.lang.String name,
                     java.lang.String value)
Constructor.
Method Detail

setName

public void setName(java.lang.String name)
Name property setter.
Parameters:
name -  

getName

public java.lang.String getName()
Name property getter.
Returns:
String name

setValue

public void setValue(java.lang.String value)
Value property setter.
Parameters:
value -  

getValue

public java.lang.String getValue()
Value property getter.
Returns:
String value

toString

public java.lang.String toString()
Get a String representation of this pair.
Overrides:
toString in class java.lang.Object

equals

public boolean equals(java.lang.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 java.lang.Object
Parameters:
object - the Object to compare to

hashCode

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


Copyright (c) 2001 - Apache Software Foundation