Package org.apache.iceberg.util
Class CharSequenceMap<V>
java.lang.Object
org.apache.iceberg.util.CharSequenceMap<V>
- Type Parameters:
V- the type of values
- All Implemented Interfaces:
Serializable,Map<CharSequence,V>
A map that uses char sequences as keys.
This implementation wraps provided keys into CharSequenceWrapper for consistent
hashing and equals behavior. This ensures that objects of different types that represent the same
sequence of characters are treated as equal keys in the map.
Note: This map is not designed for concurrent modification by multiple threads. However, it supports safe concurrent reads, assuming there are no concurrent writes.
Note: This map does not support null keys.
- See Also:
-
Nested Class Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoidclear()computeIfAbsent(CharSequence key, Supplier<V> valueSupplier) booleancontainsKey(Object key) booleancontainsValue(Object value) static <T> CharSequenceMap<T> create()entrySet()booleaninthashCode()booleanisEmpty()keySet()put(CharSequence key, V value) voidputAll(Map<? extends CharSequence, ? extends V> otherMap) intsize()toString()values()Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.Map
compute, computeIfAbsent, computeIfPresent, forEach, getOrDefault, merge, putIfAbsent, remove, replace, replace, replaceAll
-
Method Details
-
create
-
size
public int size()- Specified by:
sizein interfaceMap<CharSequence,V>
-
isEmpty
public boolean isEmpty()- Specified by:
isEmptyin interfaceMap<CharSequence,V>
-
containsKey
- Specified by:
containsKeyin interfaceMap<CharSequence,V>
-
containsValue
- Specified by:
containsValuein interfaceMap<CharSequence,V>
-
get
- Specified by:
getin interfaceMap<CharSequence,V>
-
put
- Specified by:
putin interfaceMap<CharSequence,V>
-
remove
- Specified by:
removein interfaceMap<CharSequence,V>
-
putAll
- Specified by:
putAllin interfaceMap<CharSequence,V>
-
clear
public void clear()- Specified by:
clearin interfaceMap<CharSequence,V>
-
keySet
- Specified by:
keySetin interfaceMap<CharSequence,V>
-
values
- Specified by:
valuesin interfaceMap<CharSequence,V>
-
entrySet
- Specified by:
entrySetin interfaceMap<CharSequence,V>
-
computeIfAbsent
-
equals
-
hashCode
public int hashCode() -
toString
-