public class JsonContext extends org.json.simple.JSONObject implements IJsonContext, Extendable
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K,V>| Constructor and Description |
|---|
JsonContext() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
containsKey(Object key) |
Object |
create(Object key) |
Object |
create(Object key,
boolean list) |
boolean |
extend(Extension extension) |
static <T extends JsonStorable> |
fromJson(String jsonString,
Class<T> clazz)
TODO: Add JavaDoc.
|
Object |
get(Object key) |
<T> T |
get(String key,
Class<T> castTo)
TODO: Add JavaDoc.
|
<T> T |
getCast(String key,
Class<T> castTo) |
<T extends Extension> |
getExtension(Class<T> extensionClass) |
String |
getExtensionsJson() |
Map<Object,org.apache.commons.lang3.tuple.Pair<Object,Object>> |
getHistory() |
String |
getJsonString() |
boolean |
isCollectHistory() |
void |
merge(Map from)
TODO: Add JavaDoc.
|
void |
mergeMap(Map to,
Map from,
boolean addNewOnly)
TODO: Add JavaDoc.
|
Object |
put(Object key,
Object value) |
void |
putAll(Map m) |
void |
putIfAbsent(Map from)
Put ONLY new variables to context.
|
JsonContext |
setCollectHistory(boolean collectHistory) |
void |
setExtensionsJson(String extensionsJson) |
protected void |
setJsonString(String jsonString) |
escape, toJSONString, toJSONString, toString, toString, writeJSONString, writeJSONStringclear, clone, compute, computeIfAbsent, computeIfPresent, containsValue, entrySet, forEach, getOrDefault, isEmpty, keySet, merge, putIfAbsent, remove, remove, replace, replace, replaceAll, size, valuesequals, hashCodefinalize, getClass, notify, notifyAll, wait, wait, waitclear, compute, computeIfAbsent, computeIfPresent, containsValue, entrySet, equals, forEach, getOrDefault, hashCode, isEmpty, keySet, merge, putIfAbsent, remove, remove, replace, replace, replaceAll, size, valuespublic static <T extends JsonStorable> T fromJson(String jsonString, Class<T> clazz) throws org.json.simple.parser.ParseException, IllegalAccessException, InstantiationException
org.json.simple.parser.ParseExceptionIllegalAccessExceptionInstantiationExceptionpublic <T> T get(String key, Class<T> castTo)
get in interface IJsonContextpublic void putAll(Map m)
public boolean containsKey(Object key)
containsKey in interface MapcontainsKey in class HashMappublic Object create(Object key, boolean list)
create in interface IJsonContextpublic Object create(Object key)
create in interface IJsonContextpublic <T> T getCast(String key, Class<T> castTo) throws ClassCastException
ClassCastExceptionpublic void merge(Map from)
merge in interface IJsonContextpublic void putIfAbsent(Map from)
from - - map; only new key-values from this map will be added to this (JsonContext/Map).public boolean isCollectHistory()
public JsonContext setCollectHistory(boolean collectHistory)
public boolean extend(Extension extension)
extend in interface Extendablepublic <T extends Extension> T getExtension(Class<T> extensionClass)
getExtension in interface Extendablepublic String getExtensionsJson()
getExtensionsJson in interface Extendablepublic void setExtensionsJson(String extensionsJson)
setExtensionsJson in interface Extendablepublic String getJsonString()
protected void setJsonString(String jsonString) throws org.json.simple.parser.ParseException
org.json.simple.parser.ParseExceptionCopyright © 2025. All rights reserved.