Package jodd.typeconverter.impl

Examples of jodd.typeconverter.impl.MutableLongConverter


    register(MutableShort.class, new MutableShortConverter(this));

    LongConverter longConverter = new LongConverter();
    register(Long.class, longConverter);
    register(long.class, longConverter);
    register(MutableLong.class, new MutableLongConverter(this));

    ByteConverter byteConverter = new ByteConverter();
    register(Byte.class, byteConverter);
    register(byte.class, byteConverter);
    register(MutableByte.class, new MutableByteConverter(this));
View Full Code Here


    register(MutableShort.class, new MutableShortConverter(this));

    LongConverter longConverter = new LongConverter();
    register(Long.class, longConverter);
    register(long.class, longConverter);
    register(MutableLong.class, new MutableLongConverter(this));

    ByteConverter byteConverter = new ByteConverter();
    register(Byte.class, byteConverter);
    register(byte.class, byteConverter);
    register(MutableByte.class, new MutableByteConverter(this));
View Full Code Here

public class MutableLongConverterTest {

  @Test
  public void testConversion() {
    MutableLongConverter mutableLongConverter = (MutableLongConverter) TypeConverterManager.lookup(MutableLong.class);

    assertNull(mutableLongConverter.convert(null));

    assertEquals(new MutableLong(173), mutableLongConverter.convert(new MutableLong(173)));
    assertEquals(new MutableLong(173), mutableLongConverter.convert(Integer.valueOf(173)));
    assertEquals(new MutableLong(173), mutableLongConverter.convert(Long.valueOf(173)));
    assertEquals(new MutableLong(173), mutableLongConverter.convert(Short.valueOf((short) 173)));
    assertEquals(new MutableLong(173), mutableLongConverter.convert(Double.valueOf(173.0D)));
    assertEquals(new MutableLong(173), mutableLongConverter.convert(Float.valueOf(173.0F)));
    assertEquals(new MutableLong(173), mutableLongConverter.convert("173"));
    assertEquals(new MutableLong(173), mutableLongConverter.convert(" 173 "));

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

TOP

Related Classes of jodd.typeconverter.impl.MutableLongConverter

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.