Package jodd.typeconverter.impl

Examples of jodd.typeconverter.impl.MutableDoubleConverter


    register(MutableFloat.class, new MutableFloatConverter(this));

    DoubleConverter doubleConverter = new DoubleConverter();
    register(Double.class, doubleConverter);
    register(double.class, doubleConverter);
    register(MutableDouble.class, new MutableDoubleConverter(this));

    BooleanConverter booleanConverter = new BooleanConverter();
    register(Boolean.class, booleanConverter);
    register(boolean.class, booleanConverter);
View Full Code Here


public class MutableDoubleConverterTest {

  @Test
  public void testConversion() {
    MutableDoubleConverter mutableDoubleConverter = (MutableDoubleConverter) TypeConverterManager.lookup(MutableDouble.class);

    assertNull(mutableDoubleConverter.convert(null));

    assertEquals(new MutableDouble(1.73), mutableDoubleConverter.convert(new MutableDouble(1.73)));
    assertEquals(new MutableDouble(1), mutableDoubleConverter.convert(Integer.valueOf(1)));
    assertEquals(new MutableDouble(1.73), mutableDoubleConverter.convert(Double.valueOf(1.73D)));
    assertEquals(new MutableDouble(1.73), mutableDoubleConverter.convert("1.73"));
    assertEquals(new MutableDouble(1.73), mutableDoubleConverter.convert(" 1.73 "));
    assertEquals(new MutableDouble(1.73), mutableDoubleConverter.convert(new BigDecimal("1.73")));

    try {
      mutableDoubleConverter.convert("aaaa");
      fail();
    } catch (TypeConversionException ignore) {
    }
  }
View Full Code Here

    register(MutableFloat.class, new MutableFloatConverter(this));

    DoubleConverter doubleConverter = new DoubleConverter();
    register(Double.class, doubleConverter);
    register(double.class, doubleConverter);
    register(MutableDouble.class, new MutableDoubleConverter(this));

    BooleanConverter booleanConverter = new BooleanConverter();
    register(Boolean.class, booleanConverter);
    register(boolean.class, booleanConverter);
View Full Code Here

TOP

Related Classes of jodd.typeconverter.impl.MutableDoubleConverter

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.