I\'m writing an adapter framework where I need to convert a list of objects from one class to another. I can iterate through the source list to do this as in
Java: Best
My answer to that question applies to your case:
import com.google.common.collect.Lists;
import com.google.common.base.Functions
List integers = Arrays.asList(1, 2, 3, 4);
List strings = Lists.transform(integers, Functions.toStringFunction());
The transformed list is a view on the original collection, so the transformation happens when the destination List
is accessed.