Skip to content

Instantly share code, notes, and snippets.

@geelen
Created March 12, 2009 06:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save geelen/77943 to your computer and use it in GitHub Desktop.
Save geelen/77943 to your computer and use it in GitHub Desktop.
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