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.11 $ $Date: 2003/01/23 22:47:48 $
Author:
B.C. Holmes, Sean C. Sullivan
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()
          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 -
See Also:
getName()

getName

public java.lang.String getName()
Name property getter.

Returns:
String name
See Also:
setName(String)

setValue

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

Parameters:
value -
See Also:
getValue()

getValue

public java.lang.String getValue()
Value property getter.

Returns:
String value
See Also:
setValue(String)

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()
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 © 2001-2003 Apache Software Foundation. All Rights Reserved.