I\'d like to do something like:
ArrayList objects = new ArrayList();
...
DozerBeanMapper MAPPER = new DozerBeanMapper
Not really an improvement, more like a syntactic sugar that can be achieved thanks to Guava (and most likely similar thing is possible with Apache Commons):
final List mapped = Lists.newArrayList(Iterables.transform(inputList, new Function() {
@Override public MyPojo apply(final MyEntity arg) {
return mapper.map(arg, MyPojo.class);
}
}));
This can also be turned into a generic function - as suggested in other answers.