Package jodd.mutable

Examples of jodd.mutable.MutableByte


  public void testConversion() {
    MutableByteConverter mutableByteConverter = (MutableByteConverter) TypeConverterManager.lookup(MutableByte.class);

    assertNull(mutableByteConverter.convert(null));

    assertEquals(new MutableByte((byte) 1), mutableByteConverter.convert(new MutableByte((byte) 1)));
    assertEquals(new MutableByte((byte) 1), mutableByteConverter.convert(Integer.valueOf(1)));
    assertEquals(new MutableByte((byte) 1), mutableByteConverter.convert(Short.valueOf((short) 1)));
    assertEquals(new MutableByte((byte) 1), mutableByteConverter.convert(Double.valueOf(1.0D)));
    assertEquals(new MutableByte((byte) 1), mutableByteConverter.convert("1"));
    assertEquals(new MutableByte((byte) 1), mutableByteConverter.convert(" 1 "));

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


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

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

TOP

Related Classes of jodd.mutable.MutableByte

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.