Class SensibleHashGetter

All Implemented Interfaces:
com.esotericsoftware.kryo.KryoSerializable, Serializable, Cloneable, Map<String,Object>, Getter

public class SensibleHashGetter extends HashGetter implements com.esotericsoftware.kryo.KryoSerializable
Utility class use to manage the sensible HashGetter
See Also:
  • Field Details

  • Constructor Details

    • SensibleHashGetter

      public SensibleHashGetter()
      Creates an empty instance of SensibleHashGetter
    • SensibleHashGetter

      public SensibleHashGetter(ContentChangeListener ccl)
      Creates an instance of SensibleHashGetter with a ContentChangeListener
      Parameters:
      ccl - The ContentChangeListener
    • SensibleHashGetter

      public SensibleHashGetter(int initialCapacity)
      Creates an instance of SensibleHashGetter with an initial capacity
      Parameters:
      initialCapacity - The initial capacity
    • SensibleHashGetter

      public SensibleHashGetter(Map hg)
      Creates an instance of SensibleHashGetter from a Map
      Parameters:
      hg - The map
  • Method Details

    • difference

      public static boolean difference(Object o, Object old)
      Returns if two objects are different or not.
      Parameters:
      o - The object to compare
      old - The object to compare
      Returns:
      true if there is difference between the two object, false otherwise
    • setContentChangeListener

      public void setContentChangeListener(ContentChangeListener ccl)
      Sets the ContentChangeListener
      Parameters:
      ccl - The ContentChangeListener
    • numbPut

      public boolean numbPut(String key, Object value)
      Insensitive insertion of an object
      Parameters:
      key - Of the object
      value - Of the object
      Returns:
      true if the object is added correctly, false otherwise
    • numbPut

      public boolean numbPut(String key, Object value, boolean nullAsNotContained)
      Insensitive insertion of an object
      Parameters:
      key - Of the object
      value - Of the object
      nullAsNotContained - Boolean value that indicates null as not contained
      Returns:
      true if the object is added correctly, false otherwise
    • put

      public Object put(String s, Object o)
      Specified by:
      put in interface Map<String,Object>
      Overrides:
      put in class HashMap<String,Object>
    • clear

      public void clear()
      Specified by:
      clear in interface Map<String,Object>
      Overrides:
      clear in class HashMap<String,Object>
    • remove

      public Object remove(Object o)
      Specified by:
      remove in interface Map<String,Object>
      Overrides:
      remove in class HashMap<String,Object>
    • putAll

      public void putAll(Map m)
      Specified by:
      putAll in interface Map<String,Object>
      Overrides:
      putAll in class HashGetter
    • putByPrefix

      public void putByPrefix(Map m, String prefixfilter)
      Puts in the HashGetter the map entries whose keys begin with the prefix passed as second parameter
      Parameters:
      m - Te initial map
      prefixfilter - The prefix used to filter the map entries
    • putByRE

      public void putByRE(Map m, String regex)
      Description copied from class: HashGetter
      Puts in the HashGetter the map entries whose keys satisfy the regular expression passed as second parameter
      Overrides:
      putByRE in class HashGetter
      Parameters:
      m - The initial map
      regex - The regular expression used to filter the map entries
    • putOnly

      public void putOnly(Map m, String[] ss)
      Description copied from class: HashGetter
      Puts in the HashGetter the map entries whose keys are present inside the array passed as second parameter
      Overrides:
      putOnly in class HashGetter
      Parameters:
      m - The initial map
      ss - The string array of keys used to filter the map entries
    • putOnly

      public void putOnly(Map m, Set s)
      Description copied from class: HashGetter
      Puts in the HashGetter the map entries whose keys are present inside the set passed as second parameter
      Overrides:
      putOnly in class HashGetter
      Parameters:
      m - The initial map
      s - The set used to filter the map entries
    • write

      public void write(com.esotericsoftware.kryo.Kryo kryo, com.esotericsoftware.kryo.io.Output output)
      Specified by:
      write in interface com.esotericsoftware.kryo.KryoSerializable
    • read

      public void read(com.esotericsoftware.kryo.Kryo kryo, com.esotericsoftware.kryo.io.Input input)
      Specified by:
      read in interface com.esotericsoftware.kryo.KryoSerializable