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:
java.io.Serializable
,java.util.Map<java.lang.CharSequence,V>
public class CharSequenceMap<V> extends java.lang.Object implements java.util.Map<java.lang.CharSequence,V>, java.io.Serializable
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:
- Serialized Form
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
clear()
V
computeIfAbsent(java.lang.CharSequence key, java.util.function.Supplier<V> valueSupplier)
boolean
containsKey(java.lang.Object key)
boolean
containsValue(java.lang.Object value)
static <T> CharSequenceMap<T>
create()
java.util.Set<java.util.Map.Entry<java.lang.CharSequence,V>>
entrySet()
boolean
equals(java.lang.Object other)
V
get(java.lang.Object key)
int
hashCode()
boolean
isEmpty()
java.util.Set<java.lang.CharSequence>
keySet()
V
put(java.lang.CharSequence key, V value)
void
putAll(java.util.Map<? extends java.lang.CharSequence,? extends V> otherMap)
V
remove(java.lang.Object key)
int
size()
java.lang.String
toString()
java.util.Collection<V>
values()
-
-
-
Method Detail
-
create
public static <T> CharSequenceMap<T> create()
-
size
public int size()
- Specified by:
size
in interfacejava.util.Map<java.lang.CharSequence,V>
-
isEmpty
public boolean isEmpty()
- Specified by:
isEmpty
in interfacejava.util.Map<java.lang.CharSequence,V>
-
containsKey
public boolean containsKey(java.lang.Object key)
- Specified by:
containsKey
in interfacejava.util.Map<java.lang.CharSequence,V>
-
containsValue
public boolean containsValue(java.lang.Object value)
- Specified by:
containsValue
in interfacejava.util.Map<java.lang.CharSequence,V>
-
get
public V get(java.lang.Object key)
- Specified by:
get
in interfacejava.util.Map<java.lang.CharSequence,V>
-
put
public V put(java.lang.CharSequence key, V value)
- Specified by:
put
in interfacejava.util.Map<java.lang.CharSequence,V>
-
remove
public V remove(java.lang.Object key)
- Specified by:
remove
in interfacejava.util.Map<java.lang.CharSequence,V>
-
putAll
public void putAll(java.util.Map<? extends java.lang.CharSequence,? extends V> otherMap)
- Specified by:
putAll
in interfacejava.util.Map<java.lang.CharSequence,V>
-
clear
public void clear()
- Specified by:
clear
in interfacejava.util.Map<java.lang.CharSequence,V>
-
keySet
public java.util.Set<java.lang.CharSequence> keySet()
- Specified by:
keySet
in interfacejava.util.Map<java.lang.CharSequence,V>
-
values
public java.util.Collection<V> values()
- Specified by:
values
in interfacejava.util.Map<java.lang.CharSequence,V>
-
entrySet
public java.util.Set<java.util.Map.Entry<java.lang.CharSequence,V>> entrySet()
- Specified by:
entrySet
in interfacejava.util.Map<java.lang.CharSequence,V>
-
computeIfAbsent
public V computeIfAbsent(java.lang.CharSequence key, java.util.function.Supplier<V> valueSupplier)
-
equals
public boolean equals(java.lang.Object other)
- Specified by:
equals
in interfacejava.util.Map<java.lang.CharSequence,V>
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Specified by:
hashCode
in interfacejava.util.Map<java.lang.CharSequence,V>
- Overrides:
hashCode
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-