@BenchmarkOptions(benchmarkRounds = 100, warmupRounds = 1) @Test public void mapTest() { Parent parent = getParentSample(); ParentDTO parentDTO = MapperTool.map(parent, ParentDTO.class); Assert.assertNotNull(parentDTO); Assert.assertEquals(parent.getChildren().size(), parentDTO.getChildren().size()); Assert.assertEquals(parent.getName(), parentDTO.getName()); for (int i = 0; i < parent.getChildren().size(); i++) { Assert.assertEquals(parent.getChildren().get(i).getName(), parentDTO.getChildren().get(i).getName()); Assert.assertEquals(parent.getChildren().get(i).getDescription(), parentDTO.getChildren().get(i).getDescription()); } }
public static <T> T map(final Object source, final Class<T> destinationClass) { shouldNotBeNull(source, "source"); shouldNotBeNull(destinationClass, "destinationClass"); return mapper.map(source, destinationClass); }
MapperTool { public static <T> T map(final Object source, final Class<T> destinationClass) { shouldNotBeNull(source, "source"); shouldNotBeNull(destinationClass, "destinationClass"); return mapper.map(source, destinationClass); } }
MapperTool { public static <T> T map(final Object source, final Class<T> destinationClass) { shouldNotBeNull(source, "source"); shouldNotBeNull(destinationClass, "destinationClass"); return mapper.map(source, destinationClass); } private  MapperTool(); }
MapperTool { public static <T> T map(final Object source, final Class<T> destinationClass) { shouldNotBeNull(source, "source"); shouldNotBeNull(destinationClass, "destinationClass"); return mapper.map(source, destinationClass); } private  MapperTool(); static T map(final Object source, final Class<T> destinationClass); static void map(final Object source, Object destination); static List<T> mapList(final Iterable<S> sources, final Class<T> destinationClass); static Future<T> mapAsync(final Object source, final Class<T> destinationClass); static Future<List<T>> mapListAsync(final Iterable<S> sources, final Class<T> destinationClass); }
MapperTool { public static <T> T map(final Object source, final Class<T> destinationClass) { shouldNotBeNull(source, "source"); shouldNotBeNull(destinationClass, "destinationClass"); return mapper.map(source, destinationClass); } private  MapperTool(); static T map(final Object source, final Class<T> destinationClass); static void map(final Object source, Object destination); static List<T> mapList(final Iterable<S> sources, final Class<T> destinationClass); static Future<T> mapAsync(final Object source, final Class<T> destinationClass); static Future<List<T>> mapListAsync(final Iterable<S> sources, final Class<T> destinationClass);  }