K
- type of the maps keyV
- type of the maps valuepublic static class Maps.Builder<K,V> extends Object
map
to allow its fluent creation and modification.
Check out Maps.builder()
and Maps.builder(Map)
for more
information.
public Maps.Builder<K,V> clear()
Map.clear()
.public Maps.Builder<K,V> compute(@Nullable K key, BiFunction<? super K,? super V,? extends V> remappingFunction)
Map.compute(Object, BiFunction)
.key
- key with which the specified value is to be
associatedremappingFunction
- the function to compute a valuepublic Maps.Builder<K,V> computeIfAbsent(@Nullable K key, Function<? super K,? extends V> mappingFunction)
Map.computeIfAbsent(Object, Function)
.key
- key with which the specified value is to be associatedmappingFunction
- the function to compute a valuepublic Maps.Builder<K,V> computeIfPresent(@Nullable K key, BiFunction<? super K,? super V,? extends V> remappingFunction)
Map.computeIfPresent(Object, BiFunction)
.key
- key with which the specified value is to be
associatedremappingFunction
- the function to compute a valuepublic Maps.Builder<K,V> merge(@Nullable K key, @Nullable V value, BiFunction<? super V,? super V,? extends V> remappingFunction)
Map.merge(Object, Object, BiFunction)
.key
- key with which the resulting value is to be
associatedvalue
- the non-null value to be merged with the existing
value associated with the key or, if no existing
value or a null value is associated with the key, to
be associated with the keyremappingFunction
- the function to recompute a value if presentpublic Maps.Builder<K,V> put(@Nullable K key, @Nullable V value)
Map.put(Object, Object)
.key
- key with which the specified value is to be associatedvalue
- value to be associated with the specified keypublic Maps.Builder<K,V> putAll(Map<? extends K,? extends V> map)
Map.putAll(Map)
.map
- mappings to be stored in this mappublic Maps.Builder<K,V> putIfAbsent(@Nullable K key, @Nullable V value)
Map.putIfAbsent(Object, Object)
.key
- key with which the specified value is to be associatedvalue
- value to be associated with the specified keypublic Maps.Builder<K,V> remove(@Nullable K key)
Map.remove(Object)
.key
- key whose mapping is to be removed from the mappublic Maps.Builder<K,V> remove(@Nullable K key, @Nullable V value)
Map.remove(Object, Object)
.key
- key with which the specified value is associatedvalue
- value expected to be associated with the specified keypublic Maps.Builder<K,V> replace(@Nullable K key, @Nullable V value)
Map.replace(Object, Object)
.key
- key with which the specified value is associatedvalue
- value to be associated with the specified keypublic Maps.Builder<K,V> replace(@Nullable K key, @Nullable V oldValue, @Nullable V newValue)
Map.replace(Object, Object, Object)
.key
- key with which the specified value is associatedoldValue
- value expected to be associated with the specified keynewValue
- value to be associated with the specified keypublic Maps.Builder<K,V> replaceAll(BiFunction<? super K,? super V,? extends V> function)
Map.replaceAll(BiFunction)
.function
- the function to apply to each entryCopyright © 2025. All rights reserved.