Skip to content

Instantly share code, notes, and snippets.

@danveloper
Created March 19, 2014 19:57
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 danveloper/9649954 to your computer and use it in GitHub Desktop.
Save danveloper/9649954 to your computer and use it in GitHub Desktop.
public interface WebFlowScope {
static final Map scopeMap = new HashMap();
Object getAttribute(Object key);
default public Object put(Object key, Object val) {
scopeMap.put(key, val);
return getAttribute(key);
}
default Map getScope() {
return scopeMap;
}
}
static final WebFlowScope scope = (Object key) -> "edited_" + scope.getScope().get(key);
assert scope.put("attribute", "val") == "val";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment