Package jodd.typeconverter.impl

Examples of jodd.typeconverter.impl.DoubleArrayConverter


    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));
    register(char[].class, new CharacterArrayConverter(this));

    // we don't really need these, but converters will be cached and not created every time
    register(Integer[].class, new ArrayConverter<Integer>(this, Integer.class));
View Full Code Here


public class DoubleArrayConverterTest {

  @Test
  public void testConversion() {
    DoubleArrayConverter doubleArrayConverter = (DoubleArrayConverter) TypeConverterManager.lookup(double[].class);

    assertNull(doubleArrayConverter.convert(null));

    assertEq(arrd(1.73), doubleArrayConverter.convert(Double.valueOf(1.73)));
    assertEq(arrd(1.73, 10.22), doubleArrayConverter.convert(arrd(1.73, 10.22)));
    assertEq(arrd(1.0, 7.0, 3.0), doubleArrayConverter.convert(arri(1, 7, 3)));
    assertEq(arrd(1.0, 7.0, 3.0), doubleArrayConverter.convert(arrl(1, 7, 3)));
    assertEq(arrd(1.0, 7.0, 3.0), doubleArrayConverter.convert(arrf(1, 7, 3)));
    assertEq(arrd(1.0, 0.0, 1.0), doubleArrayConverter.convert(arrl(true, false, true)));
    assertEq(arrd(1.0, 7.0, 3.0), doubleArrayConverter.convert(arrb(1, 7, 3)));
    assertEq(arrd(1.0, 7.0, 3.0), doubleArrayConverter.convert(arrs(1, 7, 3)));
    assertEq(arrd(1.73, 10.22), doubleArrayConverter.convert(arrs("1.73", "10.22")));
    assertEq(arrd(1.73, 10.22), doubleArrayConverter.convert(arrs(" 1.73 ", " 10.22 ")));
    assertEq(arrd(1.73, 10), doubleArrayConverter.convert(arro("1.73", Integer.valueOf(10))));
    assertEq(arrd(1.73, 10), doubleArrayConverter.convert("1.73 \n 10"));
  }
View Full Code Here

    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));
    register(char[].class, new CharacterArrayConverter(this));

    // we don't really need these, but converters will be cached and not created every time
    register(Integer[].class, new ArrayConverter<Integer>(this, Integer.class) {
View Full Code Here

TOP

Related Classes of jodd.typeconverter.impl.DoubleArrayConverter

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.