Interface ValueConverter<F,T>

All Known Implementing Classes:
AbstractValueConverter

public interface ValueConverter<F,T>
Contract for converting objects from one type to another. For example, you might have a ValueConverter<String, List<Integer>> which converts text like "1,2,3" to a list of numbers.
Since:
1.0.0
Author:
Mark Allen
  • Method Summary

    Modifier and Type
    Method
    Description
    convert(F from)
    Converts from to an instance of T.
     
     
  • Method Details

    • convert

      T convert(F from) throws ValueConversionException
      Converts from to an instance of T.
      Parameters:
      from - The value from which to convert. May be null.
      Returns:
      The T representation of from.
      Throws:
      ValueConversionException - If an error occurs during conversion.
    • fromType

      Type fromType()
      Returns:
      The type represented by F.
    • toType

      Type toType()
      Returns:
      The type represented by T.