001 package com.hammurapi.convert;
002
003 import com.hammurapi.util.Context;
004
005 /**
006 * Converts objects from one type to another, e.g. Integer to String.
007 * @author Pavel
008 *
009 */
010 public interface Converter {
011
012 /**
013 * Converts object to requested target type.
014 * @param source Source object.
015 * @param targetType Target type.
016 * @param context Conversion context.
017 * @return Converted object.
018 */
019 <S, T> T convert(S source, Class<T> targetType, Context context) throws ConversionException;
020 }