Examples of MutableShortConverter


Examples of jodd.typeconverter.impl.MutableShortConverter

    register(MutableInteger.class, new MutableIntegerConverter(this));

    ShortConverter shortConverter = new ShortConverter();
    register(Short.class, shortConverter);
    register(short.class, shortConverter);
    register(MutableShort.class, new MutableShortConverter(this));

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

Examples of jodd.typeconverter.impl.MutableShortConverter

    register(MutableInteger.class, new MutableIntegerConverter(this));

    ShortConverter shortConverter = new ShortConverter();
    register(Short.class, shortConverter);
    register(short.class, shortConverter);
    register(MutableShort.class, new MutableShortConverter(this));

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

Examples of jodd.typeconverter.impl.MutableShortConverter

public class MutableShortConverterTest {

  @Test
  public void testConversion() {
    MutableShortConverter mutableShortConverter = (MutableShortConverter) TypeConverterManager.lookup(MutableShort.class);

    assertNull(mutableShortConverter.convert(null));

    assertEquals(new MutableShort((short) 1), mutableShortConverter.convert(new MutableShort(1)));
    assertEquals(new MutableShort((short) 1), mutableShortConverter.convert(Integer.valueOf(1)));
    assertEquals(new MutableShort((short) 1), mutableShortConverter.convert(Short.valueOf((short) 1)));
    assertEquals(new MutableShort((short) 1), mutableShortConverter.convert(Double.valueOf(1.0D)));
    assertEquals(new MutableShort((short) 1), mutableShortConverter.convert("1"));
    assertEquals(new MutableShort((short) 1), mutableShortConverter.convert(" 1 "));

    try {
      mutableShortConverter.convert("a");
      fail();
    } catch (TypeConversionException ignore) {
    }
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.