Interface CSVConverter<T>

Type Parameters:
T - the type which should be converted to a String or created by parsing an input String.
All Known Implementing Classes:
BigDecimalConverter, CharacterConverter, CSVDateConverter, CSVUtilDateConverter, EnumConverter, IntegerConverter, ListConverter, UtilDateConverter

public interface CSVConverter<T>
Interface for implementing a converter for type T.

Conversion in both directions has to be implemented.

  • Method Summary

    Modifier and Type Method Description
    String convert​(T value)
    Convert a value to a String representation.
    T parse​(String value)
    Parse a String value to retrieve an object of type T.
  • Method Details

    • convert

      String convert​(T value)
      Convert a value to a String representation. It should be lossless, so that back conversion is possible without loss of information. However, this is not required.
      Parameters:
      value - the value of Type T to convert. May be null
      Returns:
      a String representation e.g. Object.toString()
    • parse

      T parse​(String value) throws CSVConversionException
      Parse a String value to retrieve an object of type T.
      Parameters:
      value - the String representation coming from a CSV file.
      Returns:
      the converted object.
      Throws:
      CSVConversionException - if there is a problem while parsing the input, e.g. if the format is not recognized.