Class Header


  • public class Header
    extends java.lang.Object
    Represents a single header to be set on a request.

    If multiple header values are added to a request with the same name (case-insensitive), then the values will be appended at the end of the same Header with commas separating them.

    • Constructor Summary

      Constructors 
      Constructor Description
      Header​(java.lang.String name, java.lang.String value)
      Create a Header instance using the provided name and value.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addValue​(java.lang.String value)
      Add a new value to the end of the Header.
      java.lang.String getName()
      Gets the header name.
      java.lang.String getValue()
      Gets the value of this Header.
      java.lang.String[] getValues()
      Gets the comma separated value as an array.
      java.lang.String toString()
      Gets the String representation of the header.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • Header

        public Header​(java.lang.String name,
                      java.lang.String value)
        Create a Header instance using the provided name and value.
        Parameters:
        name - the name of the header.
        value - the value of the header.
        Throws:
        java.lang.NullPointerException - if name is null.
    • Method Detail

      • getName

        public java.lang.String getName()
        Gets the header name.
        Returns:
        the name of this Header
      • getValue

        public java.lang.String getValue()
        Gets the value of this Header.
        Returns:
        the value of this Header
      • getValues

        public java.lang.String[] getValues()
        Gets the comma separated value as an array.
        Returns:
        the values of this Header that are separated by a comma
      • addValue

        public void addValue​(java.lang.String value)
        Add a new value to the end of the Header.
        Parameters:
        value - the value to add
      • toString

        public java.lang.String toString()
        Gets the String representation of the header.
        Overrides:
        toString in class java.lang.Object
        Returns:
        the String representation of this Header.