Examples of FloatToIntegerConverter


Examples of ma.glasnost.orika.converter.builtin.NumericConverters.FloatToIntegerConverter

    }
   
    @Test(expected = MappingException.class)
    public void testFloatToIntegerConverter_overflow() {
        MapperFactory factory = MappingUtil.getMapperFactory();
        factory.getConverterFactory().registerConverter(new FloatToIntegerConverter(false));
        MapperFacade mapper = factory.getMapperFacade();
       
        Float value = ((float) Integer.MAX_VALUE) * 1.1f;
        Integer result = mapper.map(value, Integer.class);
        Assert.assertEquals(value.floatValue(), result.floatValue());
View Full Code Here

Examples of ma.glasnost.orika.converter.builtin.NumericConverters.FloatToIntegerConverter

    }
   
    @Test
    public void testFloatToIntegerConverter() {
        MapperFactory factory = MappingUtil.getMapperFactory();
        factory.getConverterFactory().registerConverter(new FloatToIntegerConverter(false));
        MapperFacade mapper = factory.getMapperFacade();
       
        Float value = (float) Integer.MAX_VALUE;
        Integer result = mapper.map(value, Integer.class);
        Assert.assertEquals(value.floatValue(), result.floatValue());
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.