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

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

public static class NumericConverters.BigDecimalToDoubleConverter
extends BidirectionalConverter<BigDecimal,Double>

Provides conversion between BigDecimal and Double.

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

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

Field Summary
 
Fields inherited from class ma.glasnost.orika.CustomConverter
destinationType, mapperFacade, sourceType
 
Constructor Summary
NumericConverters.BigDecimalToDoubleConverter()
           
 
Method Summary
 BigDecimal convertFrom(Double source, Type<BigDecimal> destinationType)
           
 Double convertTo(BigDecimal source, Type<Double> 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.BigDecimalToDoubleConverter

public NumericConverters.BigDecimalToDoubleConverter()
Method Detail

convertTo

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

convertFrom

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


Copyright © 2013 Glasnost. All Rights Reserved.