Package jodd.typeconverter.impl

Examples of jodd.typeconverter.impl.ShortArrayConverter


    CharacterConverter characterConverter = new CharacterConverter();
    register(Character.class, characterConverter);
    register(char.class, characterConverter);

    register(byte[].class, new ByteArrayConverter(this));
    register(short[].class, new ShortArrayConverter(this));
    register(int[].class, new IntegerArrayConverter(this));
    register(long[].class, new LongArrayConverter(this));
    register(float[].class, new FloatArrayConverter(this));
    register(double[].class, new DoubleArrayConverter(this));
    register(boolean[].class, new BooleanArrayConverter(this));
View Full Code Here


    CharacterConverter characterConverter = new CharacterConverter();
    register(Character.class, characterConverter);
    register(char.class, characterConverter);

    register(byte[].class, new ByteArrayConverter(this));
    register(short[].class, new ShortArrayConverter(this));
    register(int[].class, new IntegerArrayConverter(this));
    register(long[].class, new LongArrayConverter(this));
    register(float[].class, new FloatArrayConverter(this));
    register(double[].class, new DoubleArrayConverter(this));
    register(boolean[].class, new BooleanArrayConverter(this));
View Full Code Here

public class ShortArrayConverterTest {

  @Test
  public void testConversion() {
    ShortArrayConverter shortArrayConverter = (ShortArrayConverter) TypeConverterManager.lookup(short[].class);

    assertNull(shortArrayConverter.convert(null));

    assertEq(arrs(1), shortArrayConverter.convert(Double.valueOf(1)));
    assertEq(arrs(1, 7, 3), shortArrayConverter.convert(arrs(1, 7, 3)));
    assertEq(arrs(1, 7, 3), shortArrayConverter.convert(arrb(1, 7, 3)));
    assertEq(arrs(1, 7, 3), shortArrayConverter.convert(arri(1, 7, 3)));
    assertEq(arrs(173, 1022), shortArrayConverter.convert(arrs("173", "1022")));
    assertEq(arrs(173, 1022), shortArrayConverter.convert(arrs(" 173 ", " 1022 ")));
    assertEq(arrs(173, 10), shortArrayConverter.convert(arro("173", Integer.valueOf(10))));
    assertEq(arrs(173, 10), shortArrayConverter.convert("173,10"));
  }
View Full Code Here

TOP

Related Classes of jodd.typeconverter.impl.ShortArrayConverter

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.