Class HiroJsonMap

    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected java.util.Map<java.lang.String,​java.lang.Object> fieldsMap
      All unknown keys - if any - of the JSON will be collected here
    • Constructor Summary

      Constructors 
      Constructor Description
      HiroJsonMap()
      Default constructor for Jackson
      HiroJsonMap​(java.util.Map<java.lang.String,​java.lang.Object> initialData)
      Constructor
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addFields​(java.util.Map<java.lang.String,​java.lang.Object> data)  
      java.util.Map<java.lang.String,​java.lang.Object> getMap()
      Returns the map of fields that have NOT been assigned to fields of derived children directly.
      void setField​(java.lang.String key, java.lang.Object value)
      Set a single field in fieldsMap.
      void setFields​(java.util.Map<java.lang.String,​java.lang.Object> data)  
      java.util.Map<java.lang.String,​java.lang.Object> toMap()
      Return a map of ALL values, including assigned fields specified in derived child classes.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • fieldsMap

        protected final java.util.Map<java.lang.String,​java.lang.Object> fieldsMap
        All unknown keys - if any - of the JSON will be collected here
    • Constructor Detail

      • HiroJsonMap

        public HiroJsonMap()
        Default constructor for Jackson
      • HiroJsonMap

        public HiroJsonMap​(java.util.Map<java.lang.String,​java.lang.Object> initialData)
        Constructor
        Parameters:
        initialData - Initial data for the fieldsMap. Data will be copied via Map.putAll(Map) into fieldsMap.
    • Method Detail

      • setField

        public void setField​(java.lang.String key,
                             java.lang.Object value)
        Set a single field in fieldsMap. This is also the generic method for Jackson to set fields.
        Parameters:
        key - Key of the field.
        value - Value of the field.
      • setFields

        public void setFields​(java.util.Map<java.lang.String,​java.lang.Object> data)
        Parameters:
        data - fieldsMap will be cleared and data will be copied via Map.putAll(Map) into it.
      • addFields

        public void addFields​(java.util.Map<java.lang.String,​java.lang.Object> data)
        Parameters:
        data - Data will be copied via Map.putAll(Map) into fieldsMap.
      • getMap

        public java.util.Map<java.lang.String,​java.lang.Object> getMap()
        Returns the map of fields that have NOT been assigned to fields of derived children directly.
        Returns:
        The map of the remaining fields.
      • toMap

        public java.util.Map<java.lang.String,​java.lang.Object> toMap()
        Return a map of ALL values, including assigned fields specified in derived child classes.
        Returns:
        The map of all fields of this object.