Package io.beanmapper.core.converter
Class SimpleBeanConverter<S,T>
java.lang.Object
io.beanmapper.core.converter.AbstractBeanConverter<S,T>
io.beanmapper.core.converter.SimpleBeanConverter<S,T>
- All Implemented Interfaces:
BeanConverter
- Direct Known Subclasses:
ObjectToStringConverter
,StringToBigDecimalConverter
,StringToBooleanConverter
,StringToByteConverter
,StringToDoubleConverter
,StringToFloatConverter
,StringToIntegerConverter
,StringToLongConverter
,StringToShortConverter
Default converter that should be used for single type-to-type conversions.
- Since:
- Jun 18, 2015
- Author:
- Jeroen van Schagen
-
Field Summary
Fields inherited from class io.beanmapper.core.converter.AbstractBeanConverter
beanMapper
-
Constructor Summary
ModifierConstructorDescriptionprotected
Construct a new bean converter, dynamically resolving the source and target class.protected
SimpleBeanConverter
(Class<? extends S> sourceClass, Class<? extends T> targetClass) Construct a new bean converter, manually declaring the source and target class. -
Method Summary
Methods inherited from class io.beanmapper.core.converter.AbstractBeanConverter
convert, isMatchingSource, isMatchingTarget, match
-
Constructor Details
-
SimpleBeanConverter
protected SimpleBeanConverter()Construct a new bean converter, dynamically resolving the source and target class.
This constructor requires a dependency to Spring. -
SimpleBeanConverter
Construct a new bean converter, manually declaring the source and target class.- Parameters:
sourceClass
- the source classtargetClass
- the target class
-
-
Method Details
-
doConvert
Convert a source instance to the target type.- Specified by:
doConvert
in classAbstractBeanConverter<S,
T> - Parameters:
source
- the source instancetargetClass
- the class type to convert to- Returns:
- the converted source instance
-
doConvert
Convert the source instance into our target type.- Parameters:
source
- the source instance- Returns:
- the converted target
-