Examples of convert()


Examples of jodd.typeconverter.impl.IntegerConverter.convert()

  @Test
  public void testConversion() {
    IntegerConverter integerConverter = new IntegerConverter();

    assertNull(integerConverter.convert(null));

    assertEquals(Integer.valueOf(1), integerConverter.convert(Integer.valueOf(1)));
    assertEquals(Integer.valueOf(1), integerConverter.convert(Short.valueOf((short) 1)));
    assertEquals(Integer.valueOf(1), integerConverter.convert(Double.valueOf(1.0D)));
    assertEquals(Integer.valueOf(1), integerConverter.convert("1"));
View Full Code Here

Examples of jodd.typeconverter.impl.LocaleConverter.convert()

  @Test
  public void testConversion() {
    LocaleConverter localeConverter = new LocaleConverter();

    assertNull(localeConverter.convert(null));

    assertEquals(new Locale("en"), localeConverter.convert("en"));
    assertEquals(new Locale("en", "US"), localeConverter.convert("en_US"));
    assertEquals(new Locale("en", "US", "win"), localeConverter.convert("en_US_win"));
View Full Code Here

Examples of jodd.typeconverter.impl.LongArrayConverter.convert()

  @Test
  public void testConversion() {
    LongArrayConverter longArrayConverter = (LongArrayConverter) TypeConverterManager.lookup(long[].class);

    assertNull(longArrayConverter.convert(null));

    assertEq(arrl(173), longArrayConverter.convert(Double.valueOf(173)));
    assertEq(arrl(173, 1022, 29929), longArrayConverter.convert(arrf(173, 1022, 29929)));
    assertEq(arrl(173, 1022, 29929), longArrayConverter.convert(arrd(173, 1022, 29929)));
    assertEq(arrl(173, 1022, 29929), longArrayConverter.convert(arri(173, 1022, 29929)));
View Full Code Here

Examples of jodd.typeconverter.impl.LongConverter.convert()

  @Test
  public void testConversion() {
    LongConverter longConverter = new LongConverter();

    assertNull(longConverter.convert(null));

    assertEquals(Long.valueOf(173), longConverter.convert(Long.valueOf(173)));

    assertEquals(Long.valueOf(173), longConverter.convert(Integer.valueOf(173)));
    assertEquals(Long.valueOf(173), longConverter.convert(Short.valueOf((short) 173)));
View Full Code Here

Examples of jodd.typeconverter.impl.MutableByteConverter.convert()

  @Test
  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)));
View Full Code Here

Examples of jodd.typeconverter.impl.MutableDoubleConverter.convert()

  @Test
  public void testConversion() {
    MutableDoubleConverter mutableDoubleConverter = (MutableDoubleConverter) TypeConverterManager.lookup(MutableDouble.class);

    assertNull(mutableDoubleConverter.convert(null));

    assertEquals(new MutableDouble(1.73), mutableDoubleConverter.convert(new MutableDouble(1.73)));
    assertEquals(new MutableDouble(1), mutableDoubleConverter.convert(Integer.valueOf(1)));
    assertEquals(new MutableDouble(1.73), mutableDoubleConverter.convert(Double.valueOf(1.73D)));
    assertEquals(new MutableDouble(1.73), mutableDoubleConverter.convert("1.73"));
View Full Code Here

Examples of jodd.typeconverter.impl.MutableFloatConverter.convert()

  @Test
  public void testConversion() {
    MutableFloatConverter mutableFloatConverter = (MutableFloatConverter) TypeConverterManager.lookup(MutableFloat.class);

    assertNull(mutableFloatConverter.convert(null));

    assertEquals(new MutableFloat(1.73f), mutableFloatConverter.convert(new MutableFloat(1.73f)));
    assertEquals(new MutableFloat(1), mutableFloatConverter.convert(Integer.valueOf(1)));
    assertEquals(new MutableFloat(1.73f), mutableFloatConverter.convert(Double.valueOf(1.73D)));
    assertEquals(new MutableFloat(1.73f), mutableFloatConverter.convert(" 1.73 "));
View Full Code Here

Examples of jodd.typeconverter.impl.MutableIntegerConverter.convert()

  @Test
  public void testConversion() {
    MutableIntegerConverter mutableIntegerConverter = (MutableIntegerConverter) TypeConverterManager.lookup(MutableInteger.class);

    assertNull(mutableIntegerConverter.convert(null));

    assertEquals(new MutableInteger(1), mutableIntegerConverter.convert(new MutableInteger(1)));
    assertEquals(new MutableInteger(1), mutableIntegerConverter.convert(Integer.valueOf(1)));
    assertEquals(new MutableInteger(1), mutableIntegerConverter.convert(Short.valueOf((short) 1)));
    assertEquals(new MutableInteger(1), mutableIntegerConverter.convert(Double.valueOf(1.0D)));
View Full Code Here

Examples of jodd.typeconverter.impl.MutableLongConverter.convert()

  @Test
  public void testConversion() {
    MutableLongConverter mutableLongConverter = (MutableLongConverter) TypeConverterManager.lookup(MutableLong.class);

    assertNull(mutableLongConverter.convert(null));

    assertEquals(new MutableLong(173), mutableLongConverter.convert(new MutableLong(173)));
    assertEquals(new MutableLong(173), mutableLongConverter.convert(Integer.valueOf(173)));
    assertEquals(new MutableLong(173), mutableLongConverter.convert(Long.valueOf(173)));
    assertEquals(new MutableLong(173), mutableLongConverter.convert(Short.valueOf((short) 173)));
View Full Code Here

Examples of jodd.typeconverter.impl.MutableShortConverter.convert()

  @Test
  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)));
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.