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

public abstract class AbstractQValueList<KEYTYPE> extends Object
Represents a base class for all QValue'd stuff
Author:
Philip Helger
  • Constructor Details

    • AbstractQValueList

      public AbstractQValueList()
      Default constructor creating an empty quality value list.
  • Method Details

    • qvalueMap

      @ReturnsMutableCopy protected final @NonNull com.helger.collection.commons.ICommonsOrderedMap<KEYTYPE,QValue> 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

      public abstract @NonNull String getAsHttpHeaderValue()
      Returns:
      The string representation of this list e.g. for usage in HTTP headers.
      Since:
      9.3.5
    • getAsHttpHeaderValue

      protected @NonNull String getAsHttpHeaderValue(@NonNull Function<KEYTYPE,String> aKeyTransformer)
      Abstract implementation that requires a converter from the KEYTYPE generic parameter to String.
      Parameters:
      aKeyTransformer - The transformer from KEYTYPE to String. May not be null.
      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 be null.
      aKeyTransformer - The transformer from T to String. May not be null.
      Returns:
      The string representation of this list e.g. for usage in HTTP headers.
      Since:
      9.3.5
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object