Class HttpHeader

java.lang.Object
akka.http.javadsl.model.HttpHeader
Direct Known Subclasses:
HttpHeader

@DoNotInherit public abstract class HttpHeader extends 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
     
  • Method Summary

    Modifier and Type
    Method
    Description
    abstract boolean
    is(String nameInLowerCase)
    Returns true if and only if nameInLowerCase.equals(lowercaseName()).
    abstract boolean
    isNot(String nameInLowerCase)
    Returns !
    abstract String
    Returns the lower-cased name of the header.
    abstract String
    Returns the name of the header.
    static HttpHeader
    parse(String name, String value)
    Attempts to parse the given header name and value string into a header model instance.
    abstract boolean
    Returns true if and only if the header is to be rendered in requests.
    abstract boolean
    Returns true if and only if the header is to be rendered in responses.
    abstract String
    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 Details

    • HttpHeader

      public HttpHeader()
  • Method Details

    • name

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

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

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

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

      public abstract boolean isNot(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(String name, String value)
      Attempts to parse the given header name and value string into a header model instance.
      Throws:
      IllegalArgumentException - if parsing is unsuccessful.