Interface MultiValueConverter<T extends Iterable<V>,V>

Type Parameters:
T - the container for the values
V - the type of the values
All Superinterfaces:
All Known Implementing Classes:

public interface MultiValueConverter<T extends Iterable<V>,V> extends Converter<T>
Implemented by converters that convert header fields with a list of values.

Minimal restrictions are imposed on the type used as container for the values. It must be Iterable to provide read access. A supplier and a function for appending values provide the required write access.

  • Method Details

    • containerSupplier

      Returns the container supplier
      the container supplier
    • valueAdder

      Returns the value adder
      the value adder
    • valueConverter

      Returns the value converter.
      the value converter
    • valueConverter

      Returns the value converter.

      In most cases, the result will be independent of the container type or instance. However, passing it makes the selection more flexible.

      the value converter
    • separateValues

      boolean separateValues()
      Return whether values should be converted to separate header fields in Converter.asFieldValue(Object).
      the value
    • asHeaderField

      default String asHeaderField(String fieldName, T value)
      Returns the string representation of this header field as it appears in an HTTP message.

      Note that the returned string may span several lines (may contain CR/LF), if the converter is a MultiValueConverter with separate values, but never has a trailing CR/LF.

      Specified by:
      asHeaderField in interface Converter<T extends Iterable<V>>
      fieldName - the field name
      value - the value
      the field as it occurs in a header