I am new in Java so please be patient.
It is common to map (convert) lists to lists. Some languages have a map
method, some (C#) Select
. How is this done with Java? Is a for
loop the only option?
I expect to be able to do something like this:
List<Customer> customers = new ArrayList<Customer>();
...
List<CustomerDto> dtos = customers.convert(new Converter(){
public convert(c) {
return new CustomerDto();
}
})
I have missed something? Please give me a starting point.