Android examples for java.util:List
transform value in List using Lambda function
//package com.book2s; import java.util.ArrayList; import java.util.List; import java.util.function.Function; public class Main { public static <T, R> List<T> transform(List<R> in, Function<R, T> function) { List<T> ret = new ArrayList<>(); for (R r : in) { ret.add(function.apply(r));/* w ww.ja v a 2s . c o m*/ } return ret; } }