This commit is contained in:
parent
015f314db0
commit
aec5c07984
1 changed files with 16 additions and 0 deletions
|
@ -63,6 +63,22 @@ public class TCN {
|
|||
map.set(key, o);
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets something in the map if it doesn't exist
|
||||
* @param key Key
|
||||
* @param o Object, can be a native type, string, or another TCN (or TCNArray)
|
||||
*/
|
||||
public void setIfAbsent(String key, Object o) {
|
||||
/*TLMap<String, Object> map = this.map;
|
||||
ArrayList<String> path = new ArrayList<>(Arrays.asList(key.split("#")));
|
||||
|
||||
while (path.size() > 1) {
|
||||
map = ((TCN) map.get(path.remove(0))).map;
|
||||
}
|
||||
*/
|
||||
map.setIfNull(key, o);
|
||||
}
|
||||
|
||||
public String getString(String key) {
|
||||
Object o = map.get(key);
|
||||
if(o != null)
|
||||
|
|
Loading…
Add table
Reference in a new issue