@FunctionalInterface
public interface TransformFunction<T, S> {
T transform (S source);
}
Doing this, you can trigger the process that converts a list of Integer into a list of String object typing something like this:
ListTransformer<String, Integer> transformer = new ListTransformer<>(sources, source -> Integer.toString(source));
List<String> result = transformer.compute();
You can notice how it all becomes more simple.
Hope it can help!
Nessun commento:
Posta un commento