Skip to content

Instantly share code, notes, and snippets.

@geelen geelen/gist:77943
Created Mar 12, 2009

Embed
What would you like to do?
public final class AnF implements F<String, Integer> {
public Integer f(String s) {
return Integer.parseInt(s);
}
}
public interface AnotherF extends F<String,Integer> {
static AnotherF _ = new AnotherF() {
public Integer f(String s) {
return Integer.parseInt(s);
}
};
}
public final class x {
public static void main(String[] args) {
List<String> someList = Arrays.asList("1", "2", "3");
List<Integer> anF = Lists.transform(someList, toFunction(new AnF()));
List<Integer> anotherF = Lists.transform(someList, toFunction(AnotherF._));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.