Class ResolvingJsonMap

All Implemented Interfaces:
Serializable, Cloneable, Map<String,Object>

public class ResolvingJsonMap extends JsonMap
Subclass of an JsonMap that automatically resolves any SVL variables in values.

Resolves variables in the following values:

All other data types are left as-is.

See Also:
See Also:
  • Constructor Details

    • ResolvingJsonMap

      public ResolvingJsonMap(VarResolverSession varResolver)
      Constructor.
      Parameters:
      varResolver - The var resolver session to use for resolving SVL variables.
  • Method Details

    • append

      Description copied from class: JsonMap
      Appends all the entries in the specified map to this map.
      Overrides:
      append in class JsonMap
      Parameters:
      values - The map to copy. Can be null.
      Returns:
      This object.
    • append

      public ResolvingJsonMap append(String key, Object value)
      Description copied from class: JsonMap
      Adds an entry to this map.
      Overrides:
      append in class JsonMap
      Parameters:
      key - The key.
      value - The value.
      Returns:
      This object.
    • appendIf

      public ResolvingJsonMap appendIf(boolean flag, String key, Object value)
      Description copied from class: JsonMap
      Add if flag is true.
      Overrides:
      appendIf in class JsonMap
      Parameters:
      flag - The flag to check.
      key - The key.
      value - The value.
      Returns:
      This object.
    • filtered

      Description copied from class: JsonMap
      Enables filtering based on a predicate test.

      If the predicate evaluates to false on values added to this map, the entry will be skipped.

      Overrides:
      filtered in class JsonMap
      Parameters:
      value - The value tester predicate.
      Returns:
      This object.
    • get

      public Object get(Object key)
      Specified by:
      get in interface Map<String,Object>
      Overrides:
      get in class JsonMap
    • inner

      Description copied from class: JsonMap
      Set an inner map in this map to allow for chained get calls.

      If JsonMap.get(Object) returns null, then JsonMap.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}"); JsonMap map2 = 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

      Overrides:
      inner in class JsonMap
      Parameters:
      inner - The inner map. Can be null to remove the inner map from an existing map.
      Returns:
      This object.
    • keepAll

      public ResolvingJsonMap keepAll(String... keys)
      Description copied from class: JsonMap
      The opposite of JsonMap.removeAll(String...).

      Discards all keys from this map that aren't in the specified list.

      Overrides:
      keepAll in class JsonMap
      Parameters:
      keys - The keys to keep.
      Returns:
      This map.
    • modifiable

      Description copied from class: JsonMap
      Returns a modifiable copy of this map if it's unmodifiable.
      Overrides:
      modifiable in class JsonMap
      Returns:
      A modifiable copy of this map if it's unmodifiable, or this map if it is already modifiable.
    • session

      Description copied from class: JsonMap
      Override 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.

      Overrides:
      session in class JsonMap
      Parameters:
      session - The new bean session.
      Returns:
      This object.
    • setBeanSession

      Description copied from class: JsonMap
      Sets the BeanSession currently associated with this map.
      Overrides:
      setBeanSession in class JsonMap
      Parameters:
      value - The BeanSession currently associated with this map.
      Returns:
      This object.
    • unmodifiable

      Description copied from class: JsonMap
      Returns an unmodifiable copy of this map if it's modifiable.
      Overrides:
      unmodifiable in class JsonMap
      Returns:
      An unmodifiable copy of this map if it's modifiable, or this map if it is already unmodifiable.