Package com.soklet.converter
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
-
Method Details
-
convert
Convertsfromto an instance ofT.- Parameters:
from- The value from which to convert. May benull.- Returns:
- The
Trepresentation offrom. - 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.
-