Created
October 26, 2015 15:25
-
-
Save Arturus/baaae17a18dbf3cf2b78 to your computer and use it in GitHub Desktop.
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
Object getOrCreate(String key, Object newValue) { | |
Object result = map.get(key); | |
if (result == null) { | |
map.put(key, newValue); | |
result = newValue; | |
} | |
return result; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment