Class BasicHeaderElement

  • All Implemented Interfaces:
    java.lang.Cloneable, HeaderElement

    public class BasicHeaderElement
    extends java.lang.Object
    implements HeaderElement, java.lang.Cloneable
    Basic implementation of HeaderElement
    Since:
    4.0
    • Constructor Detail

      • BasicHeaderElement

        public BasicHeaderElement​(java.lang.String name,
                                  java.lang.String value,
                                  NameValuePair[] parameters)
        Constructor with name, value and parameters.
        Parameters:
        name - header element name
        value - header element value. May be null
        parameters - header element parameters. May be null. Parameters are copied by reference, not by value
      • BasicHeaderElement

        public BasicHeaderElement​(java.lang.String name,
                                  java.lang.String value)
        Constructor with name and value.
        Parameters:
        name - header element name
        value - header element value. May be null
    • Method Detail

      • getName

        public java.lang.String getName()
        Description copied from interface: HeaderElement
        Returns header element name.
        Specified by:
        getName in interface HeaderElement
        Returns:
        header element name
      • getValue

        public java.lang.String getValue()
        Description copied from interface: HeaderElement
        Returns header element value.
        Specified by:
        getValue in interface HeaderElement
        Returns:
        header element value
      • getParameterCount

        public int getParameterCount()
        Description copied from interface: HeaderElement
        Returns the total count of parameters.
        Specified by:
        getParameterCount in interface HeaderElement
        Returns:
        parameter count
      • getParameter

        public NameValuePair getParameter​(int index)
        Description copied from interface: HeaderElement
        Returns parameter with the given index.
        Specified by:
        getParameter in interface HeaderElement
        Parameters:
        index - index
        Returns:
        name / value pair
      • getParameterByName

        public NameValuePair getParameterByName​(java.lang.String name)
        Description copied from interface: HeaderElement
        Returns the first parameter with the given name.
        Specified by:
        getParameterByName in interface HeaderElement
        Parameters:
        name - parameter name
        Returns:
        name / value pair
      • 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
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • clone

        public java.lang.Object clone()
                               throws java.lang.CloneNotSupportedException
        Throws:
        java.lang.CloneNotSupportedException