Package jodd.mutable

Examples of jodd.mutable.MutableFloat


   
    if (value.getClass() == MutableFloat.class) {
      return (MutableFloat) value;
    }

    return new MutableFloat(typeConverter.convert(value));
  }
View Full Code Here


  public void testConversion() {
    MutableFloatConverter mutableFloatConverter = (MutableFloatConverter) TypeConverterManager.lookup(MutableFloat.class);

    assertNull(mutableFloatConverter.convert(null));

    assertEquals(new MutableFloat(1.73f), mutableFloatConverter.convert(new MutableFloat(1.73f)));
    assertEquals(new MutableFloat(1), mutableFloatConverter.convert(Integer.valueOf(1)));
    assertEquals(new MutableFloat(1.73f), mutableFloatConverter.convert(Double.valueOf(1.73D)));
    assertEquals(new MutableFloat(1.73f), mutableFloatConverter.convert(" 1.73 "));
    assertEquals(new MutableFloat(1.73f), mutableFloatConverter.convert(new BigDecimal("1.73")));

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

TOP

Related Classes of jodd.mutable.MutableFloat

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.