Class HttpHeader
- All Implemented Interfaces:
- Renderable,- ToStringRenderable
- Direct Known Subclasses:
- Accept,- AcceptCharset,- AcceptEncoding,- AcceptLanguage,- AcceptRanges,- AccessControlAllowCredentials,- AccessControlAllowHeaders,- AccessControlAllowMethods,- AccessControlAllowOrigin,- AccessControlExposeHeaders,- AccessControlMaxAge,- AccessControlRequestHeaders,- AccessControlRequestMethod,- Age,- Allow,- Authorization,- CacheControl,- Connection,- ContentDisposition,- ContentEncoding,- ContentLength,- ContentLocation,- ContentRange,- ContentType,- Cookie,- CustomHeader,- Date,- EmptyHeader$,- ETag,- Expect,- Expires,- Host,- If$minusRange,- IfMatch,- IfModifiedSince,- IfNoneMatch,- IfUnmodifiedSince,- LastEventId,- LastModified,- Link,- Location,- Origin,- ProxyAuthenticate,- ProxyAuthorization,- Range,- RawHeader,- RawRequestURI,- Referer,- RetryAfter,- Sec$minusWebSocket$minusAccept,- Sec$minusWebSocket$minusExtensions,- Sec$minusWebSocket$minusKey,- Sec$minusWebSocket$minusVersion,- SecWebSocketProtocol,- Server,- SetCookie,- StrictTransportSecurity,- TE,- TimeoutAccess,- Trailer,- TransferEncoding,- Upgrade,- UserAgent,- WWWAuthenticate,- XForwardedFor,- XForwardedHost,- XForwardedProto,- XRealIp
- 
Nested Class SummaryNested ClassesModifier and TypeClassDescriptionstatic interfacestatic class
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionstatic <T extends HttpHeader>
 org.apache.pekko.util.OptionVal<T>fastFind(Class<T> clazz, scala.collection.immutable.Seq<HttpHeader> headers) INTERNAL APIbooleanReturns true if and only if nameInLowerCase.equals(lowercaseName()).booleanReturns !abstract StringReturns the lower-cased name of the header.abstract Stringname()Returns the name of the header.static HttpHeader.ParsingResultparse(String name, String value, HeaderParser.Settings settings) Attempts to parse the given header name and value string into a header model instance.unapply(HttpHeader header) Extract name and value from a header.abstract Stringvalue()Returns the String representation of the value of the header.Methods inherited from class org.apache.pekko.http.javadsl.model.HttpHeaderparse, renderInRequests, renderInResponsesMethods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.pekko.http.impl.util.RenderablerenderMethods inherited from interface org.apache.pekko.http.impl.util.ToStringRenderabletoString
- 
Constructor Details- 
HttpHeaderpublic HttpHeader()
 
- 
- 
Method Details- 
unapplyExtract name and value from a header. CAUTION: The name must be matched in *all-lowercase*!.- Parameters:
- header- (undocumented)
- Returns:
- (undocumented)
 
- 
parsepublic static HttpHeader.ParsingResult parse(String name, String value, HeaderParser.Settings settings) Attempts to parse the given header name and value string into a header model instance.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.Okwith 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 aParsingResult.Okwith the respective header instance holding the valid value elements and anErrorInfofor 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 aParsingResult.Okwith apekko.http.scaladsl.model.headers.RawHeaderinstance and a singleErrorInfofor 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.Okwith apekko.http.scaladsl.model.headers.RawHeaderinstance 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.- Parameters:
- name- (undocumented)
- value- (undocumented)
- settings- (undocumented)
- Returns:
- (undocumented)
 
- 
fastFindpublic static <T extends HttpHeader> org.apache.pekko.util.OptionVal<T> fastFind(Class<T> clazz, scala.collection.immutable.Seq<HttpHeader> headers) INTERNAL API
- 
nameDescription copied from class:HttpHeaderReturns the name of the header.- Specified by:
- namein class- HttpHeader
 
- 
valueDescription copied from class:HttpHeaderReturns the String representation of the value of the header.- Specified by:
- valuein class- HttpHeader
 
- 
lowercaseNameDescription copied from class:HttpHeaderReturns the lower-cased name of the header.- Specified by:
- lowercaseNamein class- HttpHeader
 
- 
isDescription copied from class:HttpHeaderReturns true if and only if nameInLowerCase.equals(lowercaseName()).- Specified by:
- isin class- HttpHeader
 
- 
isNotDescription copied from class:HttpHeaderReturns !is(nameInLowerCase).- Specified by:
- isNotin class- HttpHeader
 
- 
unsafeToString
 
-