Class ParameterizedValue.ParamValueConverterBase<P extends ParameterizedValue<U>,U>

java.lang.Object
org.jdrupes.httpcodec.types.ParameterizedValue.ParamValueConverterBase<P,U>
Type Parameters:
P - the parameterized type
U - the unparameterized type
All Implemented Interfaces:
Converter<P>
Direct Known Subclasses:
MediaRange.MediaRangeConverter, MediaType.MediaTypeConverter, ParameterizedValue.ParameterizedValueConverter
Enclosing class:
ParameterizedValue<U>

public static class ParameterizedValue.ParamValueConverterBase<P extends ParameterizedValue<U>,U> extends Object implements Converter<P>
A base class for converters for parameterized values.

Converts field values such as value; param1=value1; param2=value2.

  • Constructor Details

    • ParamValueConverterBase

      public ParamValueConverterBase(Converter<U> valueConverter, BiFunction<U,Map<String,String>,P> paramValueConstructor)
      Creates a new converter by extending the given value converter with functionality for handling the parameters.

      Parameter values are used literally (no quoting).

      Parameters:
      valueConverter - the converter for a value (without parameters)
      paramValueConstructor - a method that creates the result from an instance of the type and a map of parameters (used by fromFieldValue(String)).
    • ParamValueConverterBase

      public ParamValueConverterBase(Converter<U> valueConverter, Converter<String> paramValueConverter, BiFunction<U,Map<String,String>,P> paramValueConstructor)
      Creates a new converter by extending the given value converter with functionality for handling the parameters.
      Parameters:
      valueConverter - the converter for a value (without parameters)
      paramValueConverter - the converter for parameterValues
      paramValueConstructor - a method that creates the result from an instance of the type and a map of parameters (used by fromFieldValue(String)).
  • Method Details