Package com.gengoai.conversion
Class Tuple2TypeConverter
- java.lang.Object
-
- com.gengoai.conversion.Tuple2TypeConverter
-
- All Implemented Interfaces:
TypeConverter
- Direct Known Subclasses:
NTupleTypeConverter
,Tuple1TypeConverter
,Tuple3TypeConverter
,Tuple4TypeConverter
@MetaInfServices(TypeConverter.class) public class Tuple2TypeConverter extends Object implements TypeConverter
Map Entry and Tuple2 Converter- Author:
- David B. Bracewell
-
-
Constructor Summary
Constructors Constructor Description Tuple2TypeConverter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Object
convert(Object source, Type... parameters)
Converts an object from one type to another.protected List<?>
createList(Object source, Type... parameters)
Class[]
getConversionType()
Array of classes that this type converter can convert objects toprotected Object
getValue(int index, List<?> list, Type[] parameters)
-
-
-
Method Detail
-
getValue
protected Object getValue(int index, List<?> list, Type[] parameters) throws TypeConversionException
- Throws:
TypeConversionException
-
createList
protected List<?> createList(Object source, Type... parameters) throws TypeConversionException
- Throws:
TypeConversionException
-
convert
public Object convert(Object source, Type... parameters) throws TypeConversionException
Description copied from interface:TypeConverter
Converts an object from one type to another.- Specified by:
convert
in interfaceTypeConverter
- 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
public Class[] getConversionType()
Description copied from interface:TypeConverter
Array of classes that this type converter can convert objects to- Specified by:
getConversionType
in interfaceTypeConverter
- Returns:
- the classes that this converter can convert to
-
-