Package com.gengoai.conversion
Interface TypeConverter
-
- All Known Implementing Classes:
ArrayTypeConverter
,BaseNumberTypeConverter
,BigDecimalTypeConverter
,BigIntegerTypeConverter
,BooleanTypeConverter
,ByteTypeConverter
,CharacterTypeConverter
,CharsetTypeConverter
,ClassTypeConverter
,CollectionTypeConverter
,ConcurrentLinkedDequeTypeConverter
,ConcurrentLinkedQueueTypeConverter
,ConcurrentMapTypeConverter
,ConcurrentSkipListMapTypeConverter
,ConcurrentSkipListSetTypeConverter
,CopyOnWriteArrayListTypeConverter
,CopyOnWriteArraySetTypeConverter
,DoubleTypeConverter
,DynamicEnumTypeConverter
,EnumMapTypeConverter
,EnumSetTypeConverter
,EnumTypeConverter
,FileTypeConverter
,FloatTypeConverter
,HashMapTypeConverter
,InputStreamTypeConverter
,IntegerTypeConverter
,IteratorTypeConverter
,JavaDateTypeConverter
,JsonEntryTypeConverter
,LevelTypeConverter
,LinkedBlockingDequeTypeConverter
,LinkedBlockingQueueTypeConverter
,LinkedHashMapTypeConverter
,LinkedHashSetTypeConverter
,LinkedListTypeConverter
,ListTypeConverter
,LongTypeConverter
,MapTypeConverter
,NTupleTypeConverter
,OutputStreamTypeConverter
,PathTypeConverter
,PriorityBlockingQueueTypeConverter
,PriorityQueueTypeConverter
,ReaderTypeConverter
,ResourceTypeConverter
,SetTypeConverter
,ShortTypeConverter
,SqlDateTypeConverter
,StackTypeConverter
,StringBuilderTypeConverter
,StringTagConverter
,StringTypeConverter
,TreeMapTypeConverter
,TreeSetTypeConverter
,Tuple1TypeConverter
,Tuple2TypeConverter
,Tuple3TypeConverter
,Tuple4TypeConverter
,UriTypeConverter
,UrlTypeConverter
,WeakHashMapTypeConverter
,WriterTypeConverter
public interface TypeConverter
Defines an interface for converting one type to another. Implementations are loaded at runtime using the JavaServiceLoader
. A runtime exception will be thrown if multiple classes are trying to convert the same type.- Author:
- David B. Bracewell
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Object
convert(Object source, Type... parameters)
Converts an object from one type to another.Class[]
getConversionType()
Array of classes that this type converter can convert objects to
-
-
-
Method Detail
-
convert
Object convert(Object source, Type... parameters) throws TypeConversionException
Converts an object from one type to another.- Parameters:
source
- the source objectparameters
- the optional type parameters when using Generics.- Returns:
- the converted object
- Throws:
TypeConversionException
- the source object was not able to be converted to the target type
-
getConversionType
Class[] getConversionType()
Array of classes that this type converter can convert objects to- Returns:
- the classes that this converter can convert to
-
-