Package com.helger.http.header.specific
Class AcceptEncodingList
java.lang.Object
com.helger.http.header.AbstractQValueList<String>
com.helger.http.header.specific.AcceptEncodingList
Contains a list of Accept-Encoding values as specified by the HTTP header
- Author:
- Philip Helger
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddEncoding(String sEncoding, double dQuality) booleanexplicitlySupportsEncoding(String sEncoding) doublegetQualityOfEncoding(String sEncoding) Return the associated quality of the given encoding.getQValueOfEncoding(String sEncoding) Return the associated quality of the given encoding.booleanbooleanbooleansupportsEncoding(String sEncoding) Check if the passed encoding is supported.booleanMethods inherited from class com.helger.http.header.AbstractQValueList
equals, getAllQValues, getAllQValuesGreaterOrEqual, getAllQValuesGreaterThan, getAllQValuesLowerOrEqual, getAllQValuesLowerThan, getAsHttpHeaderValue, getAsHttpHeaderValue, hashCode, qvalueMap, toString
-
Constructor Details
-
AcceptEncodingList
public AcceptEncodingList()
-
-
Method Details
-
addEncoding
@Nonnull public AcceptEncodingList addEncoding(@Nonnull String sEncoding, @Nonnegative double dQuality) -
getQValueOfEncoding
Return the associated quality of the given encoding.- Parameters:
sEncoding- The encoding name to query. May not benull.- Returns:
- The matching
QValueand nevernull.
-
getQualityOfEncoding
Return the associated quality of the given encoding.- Parameters:
sEncoding- The encoding name to query. May not benull.- Returns:
- 0 means not accepted, 1 means fully accepted.
-
supportsEncoding
Check if the passed encoding is supported. Supported means the quality is > 0.- Parameters:
sEncoding- The encoding to be checked. May not benull.- Returns:
trueif the encoding is supported,falseif not.
-
explicitlySupportsEncoding
-
supportsGZIP
public boolean supportsGZIP() -
getUsedGZIPEncoding
- Returns:
- the accepted GZip encoding. May either be
AcceptEncodingHandler.GZIP_ENCODINGorAcceptEncodingHandler.X_GZIP_ENCODINGornull
-
supportsDeflate
public boolean supportsDeflate() -
getUsedDeflateEncoding
- Returns:
- the accepted GZip encoding. May either be
AcceptEncodingHandler.DEFLATE_ENCODINGornull
-
supportsCompress
public boolean supportsCompress() -
getUsedCompressEncoding
- Returns:
- the accepted GZip encoding. May either be
AcceptEncodingHandler.COMPRESS_ENCODINGorAcceptEncodingHandler.X_COMPRESS_ENCODINGornull
-
getAsHttpHeaderValue
- Specified by:
getAsHttpHeaderValuein classAbstractQValueList<String>- Returns:
- The string representation of this list e.g. for usage in HTTP headers.
-