Package jodd.typeconverter.impl

Examples of jodd.typeconverter.impl.BigIntegerConverter


    register(MutableShort[].class, new ArrayConverter<MutableShort>(this, MutableShort.class));
    register(MutableFloat[].class, new ArrayConverter<MutableFloat>(this, MutableFloat.class));
    register(MutableDouble[].class, new ArrayConverter<MutableDouble>(this, MutableDouble.class));

    register(BigDecimal.class, new BigDecimalConverter());
    register(BigInteger.class, new BigIntegerConverter());
    register(BigDecimal[].class, new ArrayConverter<BigDecimal>(this, BigDecimal.class));
    register(BigInteger[].class, new ArrayConverter<BigInteger>(this, BigInteger.class));

    register(java.util.Date.class, new DateConverter());
    register(java.sql.Date.class, new SqlDateConverter());
View Full Code Here


public class BigIntegerConverterTest {

  @Test
  public void testConversion() {
    BigIntegerConverter bigIntegerConverter = new BigIntegerConverter();

    assertNull(bigIntegerConverter.convert(null));

    assertEquals(new BigInteger("12345"), bigIntegerConverter.convert(new BigInteger("12345")));
    assertEquals(new BigInteger("12345"), bigIntegerConverter.convert("12345"));
    assertEquals(new BigInteger("12345"), bigIntegerConverter.convert(" 12345 "));
    assertEquals(new BigInteger("12345"), bigIntegerConverter.convert(Double.valueOf(12345.0D)));
    assertEquals(new BigInteger("123456789"), bigIntegerConverter.convert(Long.valueOf(123456789)));
  }
View Full Code Here

    register(MutableShort[].class, new ArrayConverter<MutableShort>(this, MutableShort.class));
    register(MutableFloat[].class, new ArrayConverter<MutableFloat>(this, MutableFloat.class));
    register(MutableDouble[].class, new ArrayConverter<MutableDouble>(this, MutableDouble.class));

    register(BigDecimal.class, new BigDecimalConverter());
    register(BigInteger.class, new BigIntegerConverter());
    register(BigDecimal[].class, new ArrayConverter<BigDecimal>(this, BigDecimal.class));
    register(BigInteger[].class, new ArrayConverter<BigInteger>(this, BigInteger.class));

    register(java.util.Date.class, new DateConverter());
    register(java.sql.Date.class, new SqlDateConverter());
View Full Code Here

TOP

Related Classes of jodd.typeconverter.impl.BigIntegerConverter

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.