Package jodd.typeconverter.impl

Examples of jodd.typeconverter.impl.FloatArrayConverter


    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
View Full Code Here


public class FloatArrayConverterTest {

  @Test
  public void testConversion() {
    FloatArrayConverter floatArrayConverter = (FloatArrayConverter) TypeConverterManager.lookup(float[].class);

    assertNull(floatArrayConverter.convert(null));

    assertEq(arrf((float) 1.73), floatArrayConverter.convert(Float.valueOf((float) 1.73)));
    assertEq(arrf((float) 1.73, (float) 10.22), floatArrayConverter.convert(arrf((float) 1.73, (float) 10.22)));
    assertEq(arrf((float) 1.73, (float) 10.22), floatArrayConverter.convert(arrd(1.73, 10.22)));
    assertEq(arrf((float) 1.73, (float) 10.22), floatArrayConverter.convert(arrf(1.73f, 10.22f)));
    assertEq(arrf((float) 1.0, (float) 7.0, (float) 3.0), floatArrayConverter.convert(arri(1, 7, 3)));
    assertEq(arrf((float) 1.0, (float) 7.0, (float) 3.0), floatArrayConverter.convert(arrl(1, 7, 3)));
    assertEq(arrf((float) 1.0, (float) 7.0, (float) 3.0), floatArrayConverter.convert(arrb(1, 7, 3)));
    assertEq(arrf((float) 1.0, (float) 7.0, (float) 3.0), floatArrayConverter.convert(arrs(1, 7, 3)));
    assertEq(arrf((float) 1.73, (float) 10.22), floatArrayConverter.convert(arrs("1.73", "10.22")));
    assertEq(arrf((float) 1.73, (float) 10.22), floatArrayConverter.convert(arrs(" 1.73 ", " 10.22 ")));
    assertEq(arrf((float) 1.73, 10), floatArrayConverter.convert(arro("1.73", 10)));
    assertEq(arrf((float) 1.73, 10), floatArrayConverter.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
View Full Code Here

TOP

Related Classes of jodd.typeconverter.impl.FloatArrayConverter

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.