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

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

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
      Returns:
      the container supplier
    • valueAdder

      Returns the value adder
      Returns:
      the value adder
    • valueConverter

      Deprecated.
      Returns the value converter.
      Returns:
      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.

      Returns:
      the value converter
    • separateValues

      boolean separateValues()
      Return whether values should be converted to separate header fields in Converter.asFieldValue(Object).
      Returns:
      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>>
      Parameters:
      fieldName - the field name
      value - the value
      Returns:
      the field as it occurs in a header