Class ResolvingJsonMap
- All Implemented Interfaces:
Serializable,Cloneable,Map<String,Object>
JsonMap that automatically resolves any SVL variables in values.
Resolves variables in the following values:
- Values of type
CharSequence. - Arrays containing values of type
CharSequence. - Collections containing values of type
CharSequence. - Maps containing values of type
CharSequence.
All other data types are left as-is.
See Also:
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class java.util.AbstractMap
AbstractMap.SimpleEntry<K extends Object,V extends Object>, AbstractMap.SimpleImmutableEntry<K extends Object, V extends Object> -
Field Summary
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionAdds an entry to this map.Appends all the entries in the specified map to this map.Add if flag istrue .Enables filtering based on a predicate test.Set an inner map in this map to allow for chained get calls.The opposite ofJsonMap.removeAll(String...).Returns a modifiable copy of this map if it's unmodifiable.session(BeanSession session) Override the default bean session used for converting POJOs.setBeanSession(BeanSession value) Sets theBeanSessioncurrently associated with this map.Returns an unmodifiable copy of this map if it's modifiable.Methods inherited from class org.apache.juneau.collections.JsonMap
appendFirst, appendIf, appendIfAbsent, appendIfAbsentIf, asJson, asReadableString, asString, asString, cast, cast, containsKey, containsKeyNotEmpty, containsOuterKey, create, deleteAt, entrySet, exclude, filtered, filteredMap, filteredMap, find, find, findBoolean, findInt, findKeyIgnoreCase, findList, findLong, findMap, findString, get, get, getAt, getAt, getBeanSession, getBoolean, getBoolean, getClassMeta, getFirstKey, getInt, getInt, getList, getList, getList, getList, getLong, getLong, getMap, getMap, getMap, getMap, getString, getString, getStringArray, getStringArray, getSwapped, getWithDefault, getWithDefault, getWithDefault, include, isUnmodifiable, keySet, of, of, ofJson, ofJson, ofText, ofText, postAt, put, putAt, putJson, removeAll, removeAll, removeBoolean, removeBoolean, removeInt, removeInt, removeString, removeString, removeWithDefault, toString, writeToMethods inherited from class java.util.LinkedHashMap
clear, containsValue, forEach, getOrDefault, removeEldestEntry, replaceAll, valuesMethods inherited from class java.util.HashMap
clone, compute, computeIfAbsent, computeIfPresent, isEmpty, merge, putAll, putIfAbsent, remove, remove, replace, replace, sizeMethods inherited from class java.util.AbstractMap
equals, hashCodeMethods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.Map
compute, computeIfAbsent, computeIfPresent, equals, hashCode, isEmpty, merge, putAll, putIfAbsent, remove, remove, replace, replace, size
-
Constructor Details
-
ResolvingJsonMap
Constructor.- Parameters:
varResolver- The var resolver session to use for resolving SVL variables.
-
-
Method Details
-
append
Description copied from class:JsonMapAppends all the entries in the specified map to this map. -
append
Description copied from class:JsonMapAdds an entry to this map. -
appendIf
Description copied from class:JsonMapAdd if flag istrue . -
filtered
Description copied from class:JsonMapEnables filtering based on a predicate test.If the predicate evaluates to
false on values added to this map, the entry will be skipped. -
get
-
inner
Description copied from class:JsonMapSet an inner map in this map to allow for chained get calls.If
JsonMap.get(Object)returnsnull , thenJsonMap.get(Object)will be called on the inner map.In addition to providing the ability to chain maps, this method also provides the ability to wrap an existing map inside another map so that you can add entries to the outer map without affecting the values on the inner map.
JsonMap
map1 = JsonMap.ofJson ("{foo:1}" ); JsonMapmap2 = JsonMap.of ().setInner(map1 );map2 .put("foo" , 2);// Overwrite the entry int foo1 =map1 .getInt("foo" );// foo1 == 1 int foo2 =map2 .getInt("foo" );// foo2 == 2 -
keepAll
Description copied from class:JsonMapThe opposite ofJsonMap.removeAll(String...).Discards all keys from this map that aren't in the specified list.
-
modifiable
Description copied from class:JsonMapReturns a modifiable copy of this map if it's unmodifiable.- Overrides:
modifiablein classJsonMap- Returns:
- A modifiable copy of this map if it's unmodifiable, or this map if it is already modifiable.
-
session
Description copied from class:JsonMapOverride the default bean session used for converting POJOs.Default is
BeanContext.DEFAULT, which is sufficient in most cases.Useful if you're serializing/parsing beans with transforms defined.
-
setBeanSession
Description copied from class:JsonMapSets theBeanSessioncurrently associated with this map.- Overrides:
setBeanSessionin classJsonMap- Parameters:
value- TheBeanSessioncurrently associated with this map.- Returns:
- This object.
-
unmodifiable
Description copied from class:JsonMapReturns an unmodifiable copy of this map if it's modifiable.- Overrides:
unmodifiablein classJsonMap- Returns:
- An unmodifiable copy of this map if it's modifiable, or this map if it is already unmodifiable.
-