Class AcceptEncoding
java.lang.Object
io.helidon.http.encoding.AcceptEncoding
Parsed
Accept-Encoding header values and quality matching.
This is NOT part of any supported API. If you write code that depends on this, you do so at your own risk. This code and its internal interfaces are subject to change or deletion without notice.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceContent coding with its effective quality. -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionacceptedCodings(boolean wildcardAllowed) Accepted non-identity coding qualities from this header.Select the best runtime encoding from the available codings.static AcceptEncodingParseAccept-Encodingfrom headers.identity()Match identity.Match a content coding.booleanpresent()Whether the header was present.booleanvalid()Whether parsing did not encounter malformed values.
-
Field Details
-
IDENTITY
-
WILDCARD
-
-
Method Details
-
create
ParseAccept-Encodingfrom headers.- Parameters:
headers- headers- Returns:
- parsed accept encoding
-
present
public boolean present()Whether the header was present.- Returns:
- whether
Accept-Encodingwas present
-
valid
public boolean valid()Whether parsing did not encounter malformed values.- Returns:
- whether parsed values are valid
-
match
Match a content coding.- Parameters:
coding- concrete or wildcard codingwildcardAllowed- whether wildcard may match the coding- Returns:
- coding quality if the coding is acceptable, otherwise empty
-
identity
Match identity.- Returns:
- coding quality if identity is acceptable
-
acceptedCodings
Accepted non-identity coding qualities from this header.- Parameters:
wildcardAllowed- whether wildcard should be included- Returns:
- immutable accepted non-identity coding qualities
-
best
Select the best runtime encoding from the available codings.Equal-quality concrete codings use the client header order, with the provided coding order as a fallback for wildcard and otherwise equivalent matches.
- Parameters:
codings- available concrete codings in fallback order- Returns:
- best coding, identity, or empty if none is acceptable
-