public abstract class HttpHeader extends HttpHeader implements ToStringRenderable
Modifier and Type | Class and Description |
---|---|
static interface |
HttpHeader.ParsingResult |
static class |
HttpHeader.ParsingResult$ |
Constructor and Description |
---|
HttpHeader() |
Modifier and Type | Method and Description |
---|---|
static <T extends HttpHeader> |
fastFind(java.lang.Class<T> clazz,
scala.collection.immutable.Seq<HttpHeader> headers)
INTERNAL API
|
boolean |
is(java.lang.String nameInLowerCase)
Returns true if and only if nameInLowerCase.equals(lowercaseName()).
|
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.ParsingResult |
parse(java.lang.String name,
java.lang.String value,
HeaderParser.Settings settings)
Attempts to parse the given header name and value string into a header model instance.
|
static scala.Option<scala.Tuple2<java.lang.String,java.lang.String>> |
unapply(HttpHeader header)
Extract name and value from a header.
|
java.lang.String |
unsafeToString() |
abstract java.lang.String |
value()
Returns the String representation of the value of the header.
|
parse, renderInRequests, renderInResponses
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
toString
render
public static scala.Option<scala.Tuple2<java.lang.String,java.lang.String>> unapply(HttpHeader header)
header
- (undocumented)public static HttpHeader.ParsingResult parse(java.lang.String name, java.lang.String value, HeaderParser.Settings settings)
This process has several possible outcomes:
1. The header name corresponds to a properly modelled header and
a) the value is valid for this header type.
In this case the method returns a ParsingResult.Ok
with the respective header instance and no errors.
b) the value consists of a number elements, some of which valid and some invalid, and the header type supports
partial value parsing. In this case the method returns a ParsingResult.Ok
with the respective header
instance holding the valid value elements and an ErrorInfo
for each invalid value.
c) the value has invalid elements and the header type doesn't support partial value parsing.
In this case the method returns a ParsingResult.Ok
with a pekko.http.scaladsl.model.headers.RawHeader
instance and
a single ErrorInfo
for the value parsing problem.
2. The header name does not correspond to a properly modelled header but the header name and the value are both
syntactically legal according to the basic header requirements from the HTTP specification.
(http://tools.ietf.org/html/rfc7230#section-3.2)
In this case the method returns a ParsingResult.Ok
with a pekko.http.scaladsl.model.headers.RawHeader
instance and no errors.
3. The header name or value are illegal according to the basic requirements for HTTP headers
(http://tools.ietf.org/html/rfc7230#section-3.2). In this case the method returns a ParsingResult.Error
.
name
- (undocumented)value
- (undocumented)settings
- (undocumented)public static <T extends HttpHeader> org.apache.pekko.util.OptionVal<T> fastFind(java.lang.Class<T> clazz, scala.collection.immutable.Seq<HttpHeader> headers)
public abstract java.lang.String name()
HttpHeader
name
in class HttpHeader
public abstract java.lang.String value()
HttpHeader
value
in class HttpHeader
public abstract java.lang.String lowercaseName()
HttpHeader
lowercaseName
in class HttpHeader
public boolean is(java.lang.String nameInLowerCase)
HttpHeader
is
in class HttpHeader
public boolean isNot(java.lang.String nameInLowerCase)
HttpHeader
isNot
in class HttpHeader
public java.lang.String unsafeToString()