Package io.github.connellite.collections
Record Class DelegatingNullSkippingMap<K,V>
java.lang.Object
java.lang.Record
io.github.connellite.collections.DelegatingNullSkippingMap<K,V>
- All Implemented Interfaces:
Map<K,V>
Map view over a delegate: put / putAll / putIfAbsent / merge and related mutators ignore a null key
(same rule as NullSkippingHashMap).-
Nested Class Summary
-
Constructor Summary
ConstructorsConstructorDescriptionDelegatingNullSkippingMap(Map<K, V> delegate) Creates an instance of aDelegatingNullSkippingMaprecord class. -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()computeIfAbsent(K key, Function<? super K, ? extends V> mappingFunction) computeIfPresent(K key, BiFunction<? super K, ? super V, ? extends V> remappingFunction) booleancontainsKey(Object key) booleancontainsValue(Object value) delegate()Returns the value of thedelegaterecord component.entrySet()booleanIndicates whether some other object is "equal to" this one.voidforEach(BiConsumer<? super K, ? super V> action) getOrDefault(Object key, V defaultValue) final inthashCode()Returns a hash code value for this object.booleanisEmpty()keySet()voidputIfAbsent(K key, V value) booleanbooleanvoidreplaceAll(BiFunction<? super K, ? super V, ? extends V> function) intsize()toString()Returns a string representation of this record class.values()
-
Constructor Details
-
DelegatingNullSkippingMap
Creates an instance of aDelegatingNullSkippingMaprecord class.- Parameters:
delegate- the value for thedelegaterecord component
-
-
Method Details
-
size
public int size() -
isEmpty
public boolean isEmpty() -
containsKey
- Specified by:
containsKeyin interfaceMap<K,V>
-
containsValue
- Specified by:
containsValuein interfaceMap<K,V>
-
get
-
put
-
remove
-
putAll
-
clear
public void clear() -
keySet
-
values
-
entrySet
-
getOrDefault
- Specified by:
getOrDefaultin interfaceMap<K,V>
-
forEach
-
replaceAll
- Specified by:
replaceAllin interfaceMap<K,V>
-
putIfAbsent
- Specified by:
putIfAbsentin interfaceMap<K,V>
-
remove
-
replace
-
replace
-
computeIfAbsent
- Specified by:
computeIfAbsentin interfaceMap<K,V>
-
computeIfPresent
- Specified by:
computeIfPresentin interfaceMap<K,V>
-
compute
-
merge
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
delegate
Returns the value of thedelegaterecord component.- Returns:
- the value of the
delegaterecord component
-