Class 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.

    See Also:
    Serialized Form
    • Constructor Summary

      Constructors 
      Constructor Description
      NameValuePair()
      Default constructor.
      NameValuePair​(java.lang.String name, java.lang.String value)
      Constructor.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean equals​(java.lang.Object object)  
      java.lang.String getName()
      Return the name.
      java.lang.String getValue()
      Return the current value.
      int hashCode()  
      void setName​(java.lang.String name)
      Set the name.
      void setValue​(java.lang.String value)
      Set the value.
      java.lang.String toString()
      Get a String representation of this pair.
      • Methods inherited from class java.lang.Object

        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.
        Parameters:
        name - The name.
        value - The value.
    • Method Detail

      • setName

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

        public java.lang.String getName()
        Return the name.
        Returns:
        String name The name
        See Also:
        setName(String)
      • setValue

        public void setValue​(java.lang.String value)
        Set the value.
        Parameters:
        value - The new value.
      • getValue

        public java.lang.String getValue()
        Return the current value.
        Returns:
        String value The current value.
      • toString

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

        public boolean equals​(java.lang.Object object)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object