Package jodd.mutable

Examples of jodd.mutable.MutableShort


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

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


  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

Related Classes of jodd.mutable.MutableShort

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.