Class MapBuilder<K,V>
java.lang.Object
org.springframework.data.cassandra.util.MapBuilder<K,V>
- Type Parameters:
K- The key type of the map.V- The value type of the map.
- All Implemented Interfaces:
Map<K,V>
Builder for maps, which also conveniently implements
Map via delegation for convenience so you don't have to
actually build() it.- Author:
- Matthew T. Adams, Mark Paluch
-
Nested Class Summary
-
Constructor Summary
ConstructorsConstructorDescriptionCreate a newMapBuilder.MapBuilder(Map<K, V> source) Create a new instance with a copy of the given map. -
Method Summary
Modifier and TypeMethodDescriptionbuild()Return a new map based on the current state of this builder's map.voidclear()booleancontainsKey(Object key) booleancontainsValue(Object value) MapBuilder<K,V> Add an entry to this map, then returnsthis.entrySet()boolean@Nullable VinthashCode()booleanisEmpty()keySet()static MapBuilder<Object,Object> map()Factory method to construct a newMapBuilder.static <K,V> MapBuilder<K, V> Factory method to construct a new builder with the given key & value types.static <K,V> MapBuilder<K, V> Factory method to construct a new builder with a shallow copy of the given map.void@Nullable Vintsize()values()Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.util.Map
compute, computeIfAbsent, computeIfPresent, forEach, getOrDefault, merge, putIfAbsent, remove, replace, replace, replaceAll
-
Constructor Details
-
MapBuilder
public MapBuilder()Create a newMapBuilder. -
MapBuilder
Create a new instance with a copy of the given map.- Parameters:
source- must not be null
-
-
Method Details
-
map
Factory method to construct a newMapBuilder. Convenient if imported statically. -
map
Factory method to construct a new builder with the given key & value types. Convenient if imported statically. -
map
Factory method to construct a new builder with a shallow copy of the given map. Convenient if imported statically. -
entry
Add an entry to this map, then returnsthis.- Returns:
- this
-
build
Return a new map based on the current state of this builder's map.- Returns:
- a new Map with this builder's map's current content.
-
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
-
equals
-
hashCode
public int hashCode()
-