Class CaseInsensitiveDictionary<V>
- java.lang.Object
-
- org.hibernate.internal.util.collections.CaseInsensitiveDictionary<V>
-
- Type Parameters:
V
- the type for the stored values.
@Internal public final class CaseInsensitiveDictionary<V> extends Object
Wraps a ConcurrentHashMap having all keys as Strings and ensures all keys are lowercased. It does assume keys and arguments are never null, preferring to throw a NPE over adding unnecessary checks. The public exposed methods are similar to the ones on Map, but not all Map methods are exposed - only a selection we actually need; this implies it doesn't implement Map; nothing stops us to make it implement Map but at time of writing it seems unnecessary for our purposes.
-
-
Constructor Summary
Constructors Constructor Description CaseInsensitiveDictionary()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
clear()
boolean
containsKey(String key)
void
forEach(BiConsumer<? super String,? super V> action)
V
get(String key)
V
put(String key, V value)
V
remove(String key)
Set<Map.Entry<String,V>>
unmodifiableEntrySet()
Contrary to traditional Map, we make the return unmodifiable.Set<String>
unmodifiableKeySet()
Contrary to traditional Map, we make the return unmodifiable.
-
-
-
Method Detail
-
unmodifiableKeySet
public Set<String> unmodifiableKeySet()
Contrary to traditional Map, we make the return unmodifiable.- Returns:
- the map's keySet
-
unmodifiableEntrySet
public Set<Map.Entry<String,V>> unmodifiableEntrySet()
Contrary to traditional Map, we make the return unmodifiable.- Returns:
- the map's entrySet
-
containsKey
public boolean containsKey(String key)
-
clear
public void clear()
-
forEach
public void forEach(BiConsumer<? super String,? super V> action)
-
-