Created
May 8, 2014 08:22
-
-
Save kobachi/5aa17f262b2b5b33a85c to your computer and use it in GitHub Desktop.
Applier.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Applier<E, T> implements Supplier<T>{ | |
private Function<E, T> func; | |
private E original; | |
public Applier(E original, Function<E, T> func){ | |
this.func = func; | |
this.original = original; | |
} | |
@Override | |
public T get(){ | |
return func.apply(original); | |
} | |
public static Applier<E, T> of(E original, Function<E, T> func){ | |
return new Applier<E, T>(original, func); | |
} | |
} |
Author
kobachi
commented
May 8, 2014
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment