ma.glasnost.orika.converter.builtin
Class NumericConverters.BigDecimalToFloatConverter

java.lang.Object
  extended by ma.glasnost.orika.CustomConverter<Object,Object>
      extended by ma.glasnost.orika.converter.BidirectionalConverter<BigDecimal,Float>
          extended by ma.glasnost.orika.converter.builtin.NumericConverters.BigDecimalToFloatConverter
All Implemented Interfaces:
Converter<Object,Object>, MappedTypePair<Object,Object>
Enclosing class:
NumericConverters

public static class NumericConverters.BigDecimalToFloatConverter
extends BidirectionalConverter<BigDecimal,Float>

Provides conversion between BigDecimal and Float.

Note: please consider the typical warnings regarding loss of precision when converting from BigDecimal to Float.

Author:
matt.deboer@gmail.com
See Also:
BigDecimal.floatValue()

Field Summary
 
Fields inherited from class ma.glasnost.orika.CustomConverter
destinationType, mapperFacade, sourceType
 
Constructor Summary
NumericConverters.BigDecimalToFloatConverter()
           
 
Method Summary
 BigDecimal convertFrom(Float source, Type<BigDecimal> destinationType)
           
 Float convertTo(BigDecimal source, Type<Float> destinationType)
           
 
Methods inherited from class ma.glasnost.orika.converter.BidirectionalConverter
canConvert, convert, toString
 
Methods inherited from class ma.glasnost.orika.CustomConverter
getAType, getBType, setMapperFacade
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface ma.glasnost.orika.Converter
setMapperFacade
 
Methods inherited from interface ma.glasnost.orika.MappedTypePair
getAType, getBType
 

Constructor Detail

NumericConverters.BigDecimalToFloatConverter

public NumericConverters.BigDecimalToFloatConverter()
Method Detail

convertTo

public Float convertTo(BigDecimal source,
                       Type<Float> destinationType)
Specified by:
convertTo in class BidirectionalConverter<BigDecimal,Float>

convertFrom

public BigDecimal convertFrom(Float source,
                              Type<BigDecimal> destinationType)
Specified by:
convertFrom in class BidirectionalConverter<BigDecimal,Float>


Copyright © 2013 Glasnost. All Rights Reserved.