Class HttpHeader

  • Direct Known Subclasses:
    HttpHeader

    @DoNotInherit
    public abstract class HttpHeader
    extends java.lang.Object
    The base type representing Http headers. All actual header values will be instances of one of the subtypes defined in the `headers` packages. Unknown headers will be subtypes of RawHeader. Not for user extension.
    • Constructor Summary

      Constructors 
      Constructor Description
      HttpHeader()  
    • Method Summary

      All Methods Static Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      abstract boolean is​(java.lang.String nameInLowerCase)
      Returns true if and only if nameInLowerCase.equals(lowercaseName()).
      abstract boolean isNot​(java.lang.String nameInLowerCase)
      Returns !
      abstract java.lang.String lowercaseName()
      Returns the lower-cased name of the header.
      abstract java.lang.String name()
      Returns the name of the header.
      static HttpHeader parse​(java.lang.String name, java.lang.String value)
      Attempts to parse the given header name and value string into a header model instance.
      abstract boolean renderInRequests()
      Returns true if and only if the header is to be rendered in requests.
      abstract boolean renderInResponses()
      Returns true if and only if the header is to be rendered in responses.
      abstract java.lang.String value()
      Returns the String representation of the value of the header.
      • Methods inherited from class java.lang.Object

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

      • HttpHeader

        public HttpHeader()
    • Method Detail

      • name

        public abstract java.lang.String name()
        Returns the name of the header.
      • value

        public abstract java.lang.String value()
        Returns the String representation of the value of the header.
      • lowercaseName

        public abstract java.lang.String lowercaseName()
        Returns the lower-cased name of the header.
      • is

        public abstract boolean is​(java.lang.String nameInLowerCase)
        Returns true if and only if nameInLowerCase.equals(lowercaseName()).
      • isNot

        public abstract boolean isNot​(java.lang.String nameInLowerCase)
        Returns !is(nameInLowerCase).
      • renderInRequests

        public abstract boolean renderInRequests()
        Returns true if and only if the header is to be rendered in requests.
      • renderInResponses

        public abstract boolean renderInResponses()
        Returns true if and only if the header is to be rendered in responses.
      • parse

        public static HttpHeader parse​(java.lang.String name,
                                       java.lang.String value)
        Attempts to parse the given header name and value string into a header model instance.
        Throws:
        java.lang.IllegalArgumentException - if parsing is unsuccessful.