Skip to content

Instantly share code, notes, and snippets.

@dgageot
Created March 19, 2014 08:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save dgageot/9637491 to your computer and use it in GitHub Desktop.
Save dgageot/9637491 to your computer and use it in GitHub Desktop.
public interface Function<T, R> {
R apply(T t);
static Function<?, String> toStringFunction() {
return value -> value.toString();
}
static <E> Function<E, E> identity() {
return value -> value;
}
static <R> Function<?, R> constant(R constantValue) {
return value -> constantValue;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment