Created
September 6, 2016 13:07
-
-
Save ldematte/85529316fc22beda7e8f18fefa65200c to your computer and use it in GitHub Desktop.
"Reference" class for manual closures in Java (useful in lamdbas)
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
private static class Ref<T> { | |
private T value; | |
public Ref(T value) {this.value = value;} | |
public static<U> Ref<U> of(U t) { return new Ref<U>(t); } | |
public T getValue() { return value; } | |
public void setValue(T value) { this.value = value; } | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment