Package jodd.typeconverter.impl

Examples of jodd.typeconverter.impl.BigDecimalConverter


    register(MutableByte[].class, new ArrayConverter<MutableByte>(this, MutableByte.class));
    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());
View Full Code Here


    register(MutableByte[].class, new ArrayConverter<MutableByte>(this, MutableByte.class));
    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());
View Full Code Here

public class BigDecimalConverterTest {

  @Test
  public void testConversion() {
    BigDecimalConverter bigDecimalConverter = new BigDecimalConverter();

    assertNull(bigDecimalConverter.convert(null));

    assertEquals(new BigDecimal("1.2345"), bigDecimalConverter.convert(new BigDecimal("1.2345")));
    assertEquals(new BigDecimal("1.2345"), bigDecimalConverter.convert("1.2345"));
    assertEquals(new BigDecimal("1.2345"), bigDecimalConverter.convert(" 1.2345 "));
    assertEquals(new BigDecimal("1.2345"), bigDecimalConverter.convert(Double.valueOf(1.2345D)));
    assertEquals(new BigDecimal("123456789"), bigDecimalConverter.convert(Long.valueOf(123456789)));
  }
View Full Code Here

TOP

Related Classes of jodd.typeconverter.impl.BigDecimalConverter

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.