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

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

public static class NumericConverters.BigIntegerToIntegerConverter
extends BidirectionalConverter<BigInteger,Integer>

Provides conversion between BigInteger and Integer

Author:
matt.deboer@gmail.com

Field Summary
 
Fields inherited from class ma.glasnost.orika.CustomConverter
destinationType, mapperFacade, sourceType
 
Constructor Summary
NumericConverters.BigIntegerToIntegerConverter(boolean truncate)
          Constructs a new BigIntegerToIntegerConverter, with the configured truncation behavior.
 
Method Summary
 BigInteger convertFrom(Integer source, Type<BigInteger> destinationType)
           
 Integer convertTo(BigInteger source, Type<Integer> 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.BigIntegerToIntegerConverter

public NumericConverters.BigIntegerToIntegerConverter(boolean truncate)
Constructs a new BigIntegerToIntegerConverter, with the configured truncation behavior.

Parameters:
truncate - specifies whether the converter should perform truncation; if false, an ArithmeticException is thrown for a value which is too large or too small to be accurately represented by java.lang.Integer
Method Detail

convertTo

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

convertFrom

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


Copyright © 2013 Glasnost. All Rights Reserved.