Class ObjectMap

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

public class ObjectMap extends HashMap<String,Object>
Wrapper to parse Rows as an HashMap.
Author:
Cedrick LUNVEN (@clunven)
See Also:
  • Constructor Details

    • ObjectMap

      public ObjectMap()
      Default constructor
    • ObjectMap

      public ObjectMap(Map<String,Object> map)
      Copy constructor.
      Parameters:
      map - current Map
  • Method Details

    • getObjectMapper

      public static com.fasterxml.jackson.databind.ObjectMapper getObjectMapper()
      Initialize object mapper.
      Returns:
      mapper
    • get

      public <K> K get(String key, Class<K> type, boolean required)
      Access element from the map
      Type Parameters:
      K - type f parameters
      Parameters:
      key - current configuration key
      type - configuration type
      required - if the key is required
      Returns:
      configuration value
    • getSet

      public <K> Set<K> getSet(String key, Class<K> itemClass)
    • getList

      public <K> List<K> getList(String k, Class<K> itemClass)
    • getString

      public String getString(String k)
      Access element from the map
      Parameters:
      k - current configuration key
      Returns:
      configuration value
    • getDouble

      public Double getDouble(String k)
      Access element from the map
      Parameters:
      k - current configuration key
      Returns:
      configuration value
    • getInteger

      public Integer getInteger(String k)
      Access element from the map
      Parameters:
      k - current configuration key
      Returns:
      configuration value
    • getBoolean

      public Boolean getBoolean(String k)
      Access element from the map
      Parameters:
      k - current configuration key
      Returns:
      configuration value
    • getFloat

      public Float getFloat(String k)
      Access element from the map
      Parameters:
      k - current configuration key
      Returns:
      configuration value
    • getLong

      public Long getLong(String k)
      Access element from the map
      Parameters:
      k - current configuration key
      Returns:
      configuration value
    • getShort

      public Short getShort(String k)
      Access element from the map
      Parameters:
      k - current configuration key
      Returns:
      configuration value
    • getByte

      public Byte getByte(String k)
      Access element from the map
      Parameters:
      k - current configuration key
      Returns:
      configuration value
    • getCharacter

      public Character getCharacter(String k)
      Access element from the map
      Parameters:
      k - current configuration key
      Returns:
      configuration value
    • of

      public static ObjectMap of(@NonNull @NonNull Object o)
      Convert if possible.
      Parameters:
      o - current object
      Returns:
      object map