Package io.vertx.ext.web
Interface ParsedHeaderValue
-
- All Known Subinterfaces:
LanguageHeader,MIMEHeader
public interface ParsedHeaderValue
-
-
Field Summary
Fields Modifier and Type Field Description static floatDEFAULT_WEIGHTIf no "q" parameter is present, the default weight is 1.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description <T extends ParsedHeaderValue>
TfindMatchedBy(Collection<T> matchTries)Finds the first ParsedHeaderValue in the list that matches with this header value.booleanisMatchedBy(ParsedHeaderValue matchTry)Test if this header is matched by matchTry headerbooleanisPermitted()Is this an allowed operation as specified by the corresponding header?Stringparameter(String key)The value of the parameter specified by this key.Map<String,String>parameters()The parameters specified in this header value.StringrawValue()Contains the raw value that was received from the user agentStringvalue()Holds the unparsed value of the header.
For the most part, this is the content before the semi-colon (";")floatweight()Holds the weight specified in the "q" parameter of the header.
If the parameter is not specified, 1.0 is assumed according to rfc7231intweightedOrder()An integer that represents the absolute order position of this header
-
-
-
Field Detail
-
DEFAULT_WEIGHT
static final float DEFAULT_WEIGHT
If no "q" parameter is present, the default weight is 1.
- See Also:
- Constant Field Values
-
-
Method Detail
-
rawValue
String rawValue()
Contains the raw value that was received from the user agent
-
value
String value()
Holds the unparsed value of the header.
For the most part, this is the content before the semi-colon (";")
-
weight
float weight()
Holds the weight specified in the "q" parameter of the header.
If the parameter is not specified, 1.0 is assumed according to rfc7231- Returns:
-
parameter
String parameter(String key)
The value of the parameter specified by this key. Each is one of 3 things:- null <- That key was not specified
- ParsedHeaderValue.EMPTY (tested using ==) <- The value was not specified
- [Other] <- The value of the parameter
qparameter is never present.- Returns:
-
parameters
Map<String,String> parameters()
The parameters specified in this header value. Note: Theqparameter is never present.- Returns:
- Unmodifiable Map of parameters of this header value
-
isPermitted
boolean isPermitted()
Is this an allowed operation as specified by the corresponding header?- Returns:
-
isMatchedBy
boolean isMatchedBy(ParsedHeaderValue matchTry)
Test if this header is matched by matchTry header- Parameters:
matchTry- The header to be matched from- Returns:
- true if this header represents a subset of matchTry, otherwise, false
-
findMatchedBy
<T extends ParsedHeaderValue> T findMatchedBy(Collection<T> matchTries)
Finds the first ParsedHeaderValue in the list that matches with this header value. Will return an empty Optional if none match. This method is intended for internal usage.- Parameters:
matchTries- A list of parsed headers to match from this header value- Returns:
- Optional potentially with the first matched header
-
weightedOrder
int weightedOrder()
An integer that represents the absolute order position of this header
-
-