Top Description Fields Constructors Methods
org.hibernate.internal.util.collections

public final Class CaseInsensitiveDictionary<V>

extends Object
Class Inheritance
Annotations
@Internal
Type Parameters
<V>
the type for the stored values.
Imports
java.util.Collections, .Locale, .Map, .Set, java.util.concurrent.ConcurrentHashMap, java.util.function.BiConsumer, org.hibernate.Internal

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.

Field Summary

Modifier and TypeField and Description
private final Map<String, V>

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
public boolean
containsKey(final String key)

public void
forEach(final BiConsumer<? super String, ? super V> action)

public V
get(final String key)

public V
put(final String key, V value)

public V
remove(final String key)

private static String
trueKey(final String key)

public Set<Map.Entry<String, V>>

Returns:

the map's entrySet
unmodifiableEntrySet
()

Contrary to traditional Map, we make the return unmodifiable.

public Set<String>

Returns:

the map's keySet
unmodifiableKeySet
()

Contrary to traditional Map, we make the return unmodifiable.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

mapback to summary
private final Map<String, V> map

Constructor Detail

CaseInsensitiveDictionaryback to summary
public CaseInsensitiveDictionary()

Method Detail

clearback to summary
public void clear()
containsKeyback to summary
public boolean containsKey(final String key)
forEachback to summary
public void forEach(final BiConsumer<? super String, ? super V> action)
getback to summary
public V get(final String key)
putback to summary
public V put(final String key, V value)
removeback to summary
public V remove(final String key)
trueKeyback to summary
private static String trueKey(final String key)
unmodifiableEntrySetback to summary
public Set<Map.Entry<String, V>> unmodifiableEntrySet()

Contrary to traditional Map, we make the return unmodifiable.

Returns:Set<Map.Entry<String, V>>

the map's entrySet

unmodifiableKeySetback to summary
public Set<String> unmodifiableKeySet()

Contrary to traditional Map, we make the return unmodifiable.

Returns:Set<String>

the map's keySet