Examples of MapperFacade


Examples of ma.glasnost.orika.MapperFacade

  }

  @Test
  public void testWrapperToPrimitives() {
    MapperFactory factory = MappingUtil.getMapperFactory();
    MapperFacade mapper = factory.getMapperFacade();

    WrapperAttributes source = new WrapperAttributes();

    source.setAge(27);
    source.setShortValue((short)27);
    source.setFloatValue(2.5f);
    source.setDoubleValue(22.4567d);
    source.setLongValue(System.currentTimeMillis());
    source.setName("PPPPP");
    source.setSex('H');
    source.setVip(true);

    PrimitiveAttributes destination = mapper.map(source, PrimitiveAttributes.class);

    Assert.assertEquals(source.getAge(), Integer.valueOf(destination.getAge()));
    Assert.assertEquals(source.getName(), destination.getName());
    Assert.assertEquals(source.getSex(), Character.valueOf(destination.getSex()));
    Assert.assertEquals(source.getVip(), destination.getVip());
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.