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 Details

    • CaseInsensitiveDictionary

      public CaseInsensitiveDictionary()
  • Method Details

    • get

      public V get(String key)
    • 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
    • put

      public V put(String key, V value)
    • remove

      public V remove(String key)
    • containsKey

      public boolean containsKey(String key)
    • clear

      public void clear()
    • forEach

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