Package com.helger.http.header
Class AbstractQValueList<KEYTYPE>
java.lang.Object
com.helger.http.header.AbstractQValueList<KEYTYPE>
- Type Parameters:
KEYTYPE- The key type for the map.
- Direct Known Subclasses:
AcceptCharsetList,AcceptEncodingList,AcceptLanguageList,AcceptMimeTypeList
Represents a base class for all QValue'd stuff
- Author:
- Philip Helger
-
Constructor Summary
ConstructorsConstructorDescriptionDefault constructor creating an empty quality value list. -
Method Summary
Modifier and TypeMethodDescriptionbooleangetAllQValuesGreaterOrEqual(double dQuality) Get all entries with a quality value greater than or equal to the specified threshold.getAllQValuesGreaterThan(double dQuality) Get all entries with a quality value strictly greater than the specified threshold.getAllQValuesLowerOrEqual(double dQuality) Get all entries with a quality value lower than or equal to the specified threshold.getAllQValuesLowerThan(double dQuality) Get all entries with a quality value strictly lower than the specified threshold.abstract @NonNull Stringstatic <T> @NonNull StringgetAsHttpHeaderValue(@NonNull com.helger.collection.commons.ICommonsOrderedMap<T, QValue> aMap, @NonNull Function<T, String> aKeyTransformer) Static implementation of converting a map to String.protected @NonNull StringgetAsHttpHeaderValue(@NonNull Function<KEYTYPE, String> aKeyTransformer) Abstract implementation that requires a converter from the KEYTYPE generic parameter to String.inthashCode()toString()
-
Constructor Details
-
AbstractQValueList
public AbstractQValueList()Default constructor creating an empty quality value list.
-
-
Method Details
-
qvalueMap
-
getAllQValues
@ReturnsMutableCopy public final @NonNull com.helger.collection.commons.ICommonsOrderedMap<KEYTYPE,QValue> getAllQValues()- Returns:
- A mutable copy of all key-quality value pairs. Never
null.
-
getAllQValuesLowerThan
@ReturnsMutableCopy public final @NonNull com.helger.collection.commons.ICommonsOrderedMap<KEYTYPE,QValue> getAllQValuesLowerThan(double dQuality) Get all entries with a quality value strictly lower than the specified threshold.- Parameters:
dQuality- The quality threshold.- Returns:
- A mutable copy of all matching entries. Never
null.
-
getAllQValuesLowerOrEqual
@ReturnsMutableCopy public final @NonNull com.helger.collection.commons.ICommonsOrderedMap<KEYTYPE,QValue> getAllQValuesLowerOrEqual(double dQuality) Get all entries with a quality value lower than or equal to the specified threshold.- Parameters:
dQuality- The quality threshold.- Returns:
- A mutable copy of all matching entries. Never
null.
-
getAllQValuesGreaterThan
@ReturnsMutableCopy public final @NonNull com.helger.collection.commons.ICommonsOrderedMap<KEYTYPE,QValue> getAllQValuesGreaterThan(double dQuality) Get all entries with a quality value strictly greater than the specified threshold.- Parameters:
dQuality- The quality threshold.- Returns:
- A mutable copy of all matching entries. Never
null.
-
getAllQValuesGreaterOrEqual
@ReturnsMutableCopy public final @NonNull com.helger.collection.commons.ICommonsOrderedMap<KEYTYPE,QValue> getAllQValuesGreaterOrEqual(double dQuality) Get all entries with a quality value greater than or equal to the specified threshold.- Parameters:
dQuality- The quality threshold.- Returns:
- A mutable copy of all matching entries. Never
null.
-
getAsHttpHeaderValue
- Returns:
- The string representation of this list e.g. for usage in HTTP headers.
- Since:
- 9.3.5
-
getAsHttpHeaderValue
Abstract implementation that requires a converter from the KEYTYPE generic parameter to String.- Parameters:
aKeyTransformer- The transformer from KEYTYPE to String. May not benull.- Returns:
- The string representation of this list e.g. for usage in HTTP headers.
- Since:
- 9.3.5
-
getAsHttpHeaderValue
public static <T> @NonNull String getAsHttpHeaderValue(@NonNull com.helger.collection.commons.ICommonsOrderedMap<T, QValue> aMap, @NonNull Function<T, String> aKeyTransformer) Static implementation of converting a map to String.- Type Parameters:
T- Key type- Parameters:
aMap- The map to be converted. May not benull.aKeyTransformer- The transformer from T to String. May not benull.- Returns:
- The string representation of this list e.g. for usage in HTTP headers.
- Since:
- 9.3.5
-
equals
-
hashCode
public int hashCode() -
toString
-