Class TransformedKeyMap<OK,TK,V>
java.lang.Object
com.kingsrook.qqq.backend.core.utils.collections.TransformedKeyMap<OK,TK,V>
- All Implemented Interfaces:
Map<OK,V>
- Direct Known Subclasses:
CaseInsensitiveKeyMap,TypeTolerantKeyMap
Version of a map that uses a transformation function on keys. The original
idea being, e.g., to support case-insensitive keys via a toLowerCase transform.
e.g., map.put("One", 1); map.get("ONE") == 1.
But, implemented generically to support any transformation function.
keySet() and entries() should give only the first version of a key that overlapped.
e.g., map.put("One", 1); map.put("one", 1); map.keySet() == Set.of("One");
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()booleancontainsKey(Object key) booleancontainsValue(Object value) entrySet()booleanisEmpty()keySet()voidintsize()@NotNull Collection<V> values()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.util.Map
compute, computeIfAbsent, computeIfPresent, equals, forEach, getOrDefault, hashCode, merge, putIfAbsent, remove, replace, replace, replaceAll
-
Constructor Details
-
TransformedKeyMap
-
TransformedKeyMap
-
-
Method Details
-
size
-
isEmpty
-
containsKey
- Specified by:
containsKeyin interfaceMap<OK,TK>
-
containsValue
- Specified by:
containsValuein interfaceMap<OK,TK>
-
get
-
put
-
remove
-
putAll
-
clear
-
keySet
-
values
-
entrySet
-