Java examples for Lambda Stream:Function
transform List of Item using Lambda Function
//package com.java2s; import java.util.ArrayList; import java.util.List; import java.util.function.Function; public class Main { public static <T, R> List<R> transform(List<T> origValues, Function<T, R> transformer) { List<R> transformedValues = new ArrayList<>(); for (T value : origValues) { transformedValues.add(transformer.apply(value)); }/* w w w .ja v a 2s . c o m*/ return (transformedValues); } }