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 TypeMethodDescription@NonNull AcceptEncodingListaddEncoding(@NonNull String sEncoding, double dQuality) Add an encoding with the given quality.booleanexplicitlySupportsEncoding(@NonNull String sEncoding) Check if the passed encoding is explicitly supported (without wildcard fallback).@NonNull StringdoublegetQualityOfEncoding(@NonNull String sEncoding) Return the associated quality of the given encoding.@NonNull QValuegetQValueOfEncoding(@NonNull String sEncoding) Return the associated quality of the given encoding.@Nullable String@Nullable String@Nullable StringbooleanbooleanbooleansupportsEncoding(@NonNull 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()Constructor creating an empty accept encoding list.
-
-
Method Details
-
addEncoding
public @NonNull AcceptEncodingList addEncoding(@NonNull String sEncoding, @Nonnegative double dQuality) Add an encoding with the given quality.- Parameters:
sEncoding- The encoding name to add. May neither benullnor empty.dQuality- The quality value between 0 and 1.- Returns:
- this for chaining
-
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
Check if the passed encoding is explicitly supported (without wildcard fallback). Supported means the quality is > 0.- Parameters:
sEncoding- The encoding to be checked. May not benull.- Returns:
trueif the encoding is explicitly supported,falseif not.
-
supportsGZIP
public boolean supportsGZIP()- Returns:
trueif GZIP encoding (gzip or x-gzip) is supported,falseotherwise.
-
getUsedGZIPEncoding
- Returns:
- the accepted GZip encoding. May either be
AcceptEncodingHandler.GZIP_ENCODINGorAcceptEncodingHandler.X_GZIP_ENCODINGornull
-
supportsDeflate
public boolean supportsDeflate()- Returns:
trueif deflate encoding is supported,falseotherwise.
-
getUsedDeflateEncoding
- Returns:
- the accepted GZip encoding. May either be
AcceptEncodingHandler.DEFLATE_ENCODINGornull
-
supportsCompress
public boolean supportsCompress()- Returns:
trueif compress encoding (compress or x-compress) is supported,falseotherwise.
-
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.
-