Class CaseInsensitiveMap<T>
java.lang.Object
com.aquima.interactions.foundation.utility.CaseInsensitiveMap<T>
- All Implemented Interfaces:
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:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interface
Interface describing the methods available for an entry of the CaseInsensitiveMap. -
Constructor Summary
ConstructorsConstructorDescriptionConstruct a case insensitive map with a default capacity.CaseInsensitiveMap
(int capacity) Construct a case insensitive map with a given capacity.CaseInsensitiveMap
(CaseInsensitiveMap<T> other) -
Method Summary
Modifier and TypeMethodDescriptionvoid
clear()
This method removes all values from the hash map.boolean
containsKey
(String key) This method that returns true when the hashmap contains a value for the provided key (case insensitive).entrySet()
This method return all the entries in this map in a set.This method that returns the value for the provided key (case insensitive).keySet()
This method return the key set: a Set with String values.This method that puts a value for the provided key (case insensitive).void
putAll
(CaseInsensitiveMap<T> map) This method that puts all values of another case insensitve map to this map.This method that removes the value for the provided key (case insensitive).int
size()
This method return the size of this hash map.toString()
-
Constructor Details
-
CaseInsensitiveMap
public CaseInsensitiveMap()Construct a case insensitive map with a default capacity. -
CaseInsensitiveMap
-
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
This method return the key set: a Set with String values.- Returns:
- A set with String values, never null.
-
containsKey
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.
-
get
This method that returns the value for the provided key (case insensitive).- Parameters:
key
- The key, may not be null.
-
remove
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.
-
put
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
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
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 hasmap (>= 0)
-
toString
-