Class JsonTree


  • public class JsonTree
    extends Object
    Build a Map of Objects, suitable for marshalling by Jackson. Include conditional logic, so null values, empty maps, or empty lists will not be added, unless you use the special values.
    • Field Detail

      • EMPTY_JSON_MAP

        public static final Map<String,​Object> EMPTY_JSON_MAP
        Empty maps will not be added, except for this one.
      • EMPTY_JSON_LIST

        public static final List<Object> EMPTY_JSON_LIST
        Empty lists will not be added, except for this one.
    • Constructor Detail

      • JsonTree

        public JsonTree()
    • Method Detail

      • tree

        public static JsonTree tree()
        Create the tree
      • ifPositive

        public static Integer ifPositive​(int i)
        This will cause negative integers to be ignored.