Class NonNullMap<K,V>
java.lang.Object
org.kingdoms.utils.internal.nonnull.NonNullMap<K,V>
- All Implemented Interfaces:
Map<K,V>
No one uses maps to store null shit. Like what the fuck java.
Note: put()'ing a null value with a valid key causes values() to return that null
-
Nested Class Summary
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic <K,V> NonNullMap<K, V> voidclear()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) static <K,V> NonNullMap<K, V> Copies the contents of the map if null security is important since the passed instance be modified by the caller.entrySet()voidforEach(BiConsumer<? super K, ? super V> action) getOrDefault(Object key, V defaultValue) booleanisEmpty()keySet()static <K,V> NonNullMap<K, V> voidputIfAbsent(K key, V value) booleanbooleanvoidreplaceAll(BiFunction<? super K, ? super V, ? extends V> function) intsize()values()
-
Constructor Details
-
NonNullMap
-
NonNullMap
public NonNullMap(int size) -
NonNullMap
public NonNullMap()
-
-
Method Details
-
of
-
checked
-
copyOf
Copies the contents of the map if null security is important since the passed instance be modified by the caller. -
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
public V computeIfPresent(K key, @NotNull BiFunction<? super K, ? super V, ? extends V> remappingFunction) - Specified by:
computeIfPresentin interfaceMap<K,V>
-
compute
-
merge
-