Skip to content

Instantly share code, notes, and snippets.

@nschlimm
Created January 30, 2019 14:24
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 nschlimm/782eee30034d2330c4c3412d17a8f383 to your computer and use it in GitHub Desktop.
Save nschlimm/782eee30034d2330c4c3412d17a8f383 to your computer and use it in GitHub Desktop.
public enum UpdateState {
UPDATEABLE(()->Validate.validState(true)), READONLY(()->Validate.validState(false));
private Runnable action;
private UpdateState(Runnable action) {
this.action=action;
}
public <T> T set(T value) {
action.run();
return value;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment