@Singleton public class MapToObjectConverter extends Object implements TypeConverter<Map,Object>
BeanPropertyBinder
to bind maps to Object
instances.Constructor and Description |
---|
MapToObjectConverter(BeanPropertyBinder beanPropertyBinder)
Deprecated.
Use
MapToObjectConverter(Provider) instead |
MapToObjectConverter(Provider<BeanPropertyBinder> beanPropertyBinder) |
Modifier and Type | Method and Description |
---|---|
Optional<Object> |
convert(Map map,
Class<Object> targetType,
ConversionContext context)
Converts from the given source object type to the target type.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
convert, of
@Deprecated public MapToObjectConverter(BeanPropertyBinder beanPropertyBinder)
MapToObjectConverter(Provider)
insteadbeanPropertyBinder
- To bind map and Java bean properties@Inject public MapToObjectConverter(Provider<BeanPropertyBinder> beanPropertyBinder)
beanPropertyBinder
- To bind map and Java bean propertiespublic Optional<Object> convert(Map map, Class<Object> targetType, ConversionContext context)
TypeConverter
Optional.empty()
in case the object is not convertible by catching any necessary exceptions and failing gracefully.convert
in interface TypeConverter<Map,Object>
map
- The object typetargetType
- The target type being converted tocontext
- The ConversionContext