Package graphql.collect
Class ImmutableMapWithNullValues<K,V>
java.lang.Object
graphql.collect.ImmutableMapWithNullValues<K,V>
- Type Parameters:
K
- for keyV
- for victory
- All Implemented Interfaces:
Map<K,
V>
The standard ImmutableMap does not allow null values. The implementation does.
We have cases in graphql, around arguments where a map entry can be explicitly set to null
and we want immutable smart maps for these cases.
-
Nested Class Summary
-
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivate
Only used to construct the singleton empty mapprivate
ImmutableMapWithNullValues
(Map<K, V> values) -
Method Summary
Modifier and TypeMethodDescriptionvoid
clear()
Deprecated.Deprecated.computeIfAbsent
(K key, Function<? super K, ? extends V> mappingFunction) Deprecated.computeIfPresent
(K key, BiFunction<? super K, ? super V, ? extends V> remappingFunction) Deprecated.boolean
containsKey
(Object key) boolean
containsValue
(Object value) static <K,
V> ImmutableMapWithNullValues <K, V> static <K,
V> ImmutableMapWithNullValues <K, V> emptyMap()
entrySet()
boolean
void
forEach
(BiConsumer<? super K, ? super V> action) getOrDefault
(Object key, V defaultValue) int
hashCode()
boolean
isEmpty()
keySet()
Deprecated.Deprecated.void
Deprecated.putIfAbsent
(K key, V value) Deprecated.Deprecated.boolean
Deprecated.Deprecated.boolean
Deprecated.void
replaceAll
(BiFunction<? super K, ? super V, ? extends V> function) Deprecated.int
size()
toString()
values()
-
Field Details
-
delegate
-
emptyMap
-
-
Constructor Details
-
ImmutableMapWithNullValues
-
ImmutableMapWithNullValues
private ImmutableMapWithNullValues()Only used to construct the singleton empty map
-
-
Method Details
-
emptyMap
-
copyOf
-
size
public int size() -
isEmpty
public boolean isEmpty() -
containsKey
- Specified by:
containsKey
in interfaceMap<K,
V>
-
containsValue
- Specified by:
containsValue
in interfaceMap<K,
V>
-
get
-
put
Deprecated. -
remove
Deprecated. -
putAll
Deprecated. -
clear
Deprecated. -
keySet
-
values
-
entrySet
-
equals
-
hashCode
public int hashCode() -
getOrDefault
- Specified by:
getOrDefault
in interfaceMap<K,
V>
-
forEach
-
replaceAll
Deprecated.- Specified by:
replaceAll
in interfaceMap<K,
V>
-
putIfAbsent
Deprecated.- Specified by:
putIfAbsent
in interfaceMap<K,
V>
-
remove
Deprecated. -
replace
Deprecated. -
replace
Deprecated. -
computeIfAbsent
Deprecated.- Specified by:
computeIfAbsent
in interfaceMap<K,
V>
-
computeIfPresent
@Deprecated public V computeIfPresent(K key, BiFunction<? super K, ? super V, ? extends V> remappingFunction) Deprecated.- Specified by:
computeIfPresent
in interfaceMap<K,
V>
-
compute
Deprecated. -
merge
@Deprecated public V merge(K key, V value, BiFunction<? super V, ? super V, ? extends V> remappingFunction) Deprecated. -
toString
-