Class CaseInsensitiveMap<T>

java.lang.Object
com.aquima.interactions.foundation.utility.CaseInsensitiveMap<T>
All Implemented Interfaces:
Serializable

public class CaseInsensitiveMap<T> extends Object implements Serializable
Simple hashmap that has case insensitive keys. Null keys are not allowed by this implementation.
Since:
9.0
Author:
Jon van Leuven
See Also:
  • Constructor Details

    • CaseInsensitiveMap

      public CaseInsensitiveMap()
      Construct a case insensitive map with a default capacity.
    • CaseInsensitiveMap

      public CaseInsensitiveMap(CaseInsensitiveMap<T> other)
    • CaseInsensitiveMap

      public CaseInsensitiveMap(int capacity)
      Construct a case insensitive map with a given capacity.
      Parameters:
      capacity - The initial capacity of the hashmap.
  • Method Details

    • keySet

      public Set<String> keySet()
      This method return the key set: a Set with String values.
      Returns:
      A set with String values, never null.
    • containsKey

      public boolean containsKey(String key)
      This method that returns true when the hashmap contains a value for the provided key (case insensitive).
      Parameters:
      key - The key, may not be null.
      Returns:
      whether the key is contained in the map
    • get

      public T get(String key)
      This method that returns the value for the provided key (case insensitive).
      Parameters:
      key - The key, may not be null.
      Returns:
      the value for the specified key
    • remove

      public T remove(String key)
      This method that removes the value for the provided key (case insensitive).
      Parameters:
      key - The value that was available for the key before it was removed, may not be null.
      Returns:
      the value for the key if present
    • put

      public T put(String key, T attrValue)
      This method that puts a value for the provided key (case insensitive).
      Parameters:
      key - The key, may not be null.
      attrValue - The value, may be null.
      Returns:
      The previous value associated with specified key, may be null.
    • putAll

      public void putAll(CaseInsensitiveMap<T> map)
      This method that puts all values of another case insensitve map to this map.
      Parameters:
      map - The other map, may not be null.
    • clear

      public void clear()
      This method removes all values from the hash map.
    • entrySet

      public Set<CaseInsensitiveMap.Entry<T>> entrySet()
      This method return all the entries in this map in a set. The set contains CaseInsensitiveMap.Entry instances.
      Returns:
      The set with all the entries of this map, never null.
    • size

      public int size()
      This method return the size of this hash map.
      Returns:
      The size of this hashmap (>= 0)
    • toString

      public String toString()
      Overrides:
      toString in class Object