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
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 TypeMethodDescriptionvoid
clear()
boolean
containsKey
(Object key) boolean
containsValue
(Object value) entrySet()
boolean
isEmpty()
keySet()
void
int
size()
@NotNull Collection
<V> values()
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods 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:
containsKey
in interfaceMap<OK,
TK>
-
containsValue
- Specified by:
containsValue
in interfaceMap<OK,
TK>
-
get
-
put
-
remove
-
putAll
-
clear
-
keySet
-
values
-
entrySet
-