Class ManagedMap<K,V>
java.lang.Object
java.util.AbstractMap<K,V>
java.util.HashMap<K,V>
java.util.LinkedHashMap<K,V>
org.springframework.beans.factory.support.ManagedMap<K,V>
- Type Parameters:
K- the key typeV- the value type
- All Implemented Interfaces:
Serializable, Cloneable, Map<K,V>, SequencedMap<K, V>, BeanMetadataElement, Mergeable
Tag collection class used to hold managed Map values, which may
include runtime bean references (to be resolved into bean objects).
- Since:
- 27.05.2003
- Author:
- Juergen Hoeller, Rob Harrop
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class AbstractMap
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K, V> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturn the default key type name (class name) to be used for this map.Return the configuration sourceObjectfor this metadata element (may benull).Return the default value type name (class name) to be used for this map.booleanIs merging enabled for this particular instance?Merge the current value set with that of the supplied object.static <K,V> ManagedMap <K, V> Return a new instance containing keys and values extracted from the given entries.voidsetKeyTypeName(@Nullable String keyTypeName) Set the default key type name (class name) to be used for this map.voidsetMergeEnabled(boolean mergeEnabled) Set whether merging should be enabled for this collection, in case of a 'parent' collection value being present.voidSet the configuration sourceObjectfor this metadata element.voidsetValueTypeName(@Nullable String valueTypeName) Set the default value type name (class name) to be used for this map.Methods inherited from class LinkedHashMap
clear, containsValue, entrySet, forEach, get, getOrDefault, keySet, newLinkedHashMap, putFirst, putLast, removeEldestEntry, replaceAll, reversed, sequencedEntrySet, sequencedKeySet, sequencedValues, valuesMethods inherited from class HashMap
clone, compute, computeIfAbsent, computeIfPresent, containsKey, isEmpty, merge, newHashMap, put, putAll, putIfAbsent, remove, remove, replace, replace, sizeMethods inherited from class AbstractMap
equals, hashCode, toStringMethods inherited from interface Map
compute, computeIfAbsent, computeIfPresent, containsKey, equals, hashCode, isEmpty, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, sizeMethods inherited from interface SequencedMap
firstEntry, lastEntry, pollFirstEntry, pollLastEntry
-
Constructor Details
-
ManagedMap
public ManagedMap() -
ManagedMap
public ManagedMap(int initialCapacity)
-
-
Method Details
-
ofEntries
@SafeVarargs public static <K,V> ManagedMap<K,V> ofEntries(Map.Entry<? extends K, ? extends V>... entries) Return a new instance containing keys and values extracted from the given entries. The entries themselves are not stored in the map.- Type Parameters:
K- theMap's key typeV- theMap's value type- Parameters:
entries-Map.Entrys containing the keys and values from which the map is populated- Returns:
- a
Mapcontaining the specified mappings - Since:
- 5.3.16
-
setSource
-
getSource
Description copied from interface:BeanMetadataElementReturn the configuration sourceObjectfor this metadata element (may benull).- Specified by:
getSourcein interfaceBeanMetadataElement
-
setKeyTypeName
-
getKeyTypeName
-
setValueTypeName
-
getValueTypeName
-
setMergeEnabled
public void setMergeEnabled(boolean mergeEnabled) Set whether merging should be enabled for this collection, in case of a 'parent' collection value being present. -
isMergeEnabled
public boolean isMergeEnabled()Description copied from interface:MergeableIs merging enabled for this particular instance?- Specified by:
isMergeEnabledin interfaceMergeable
-
merge
Description copied from interface:MergeableMerge the current value set with that of the supplied object.The supplied object is considered the parent, and values in the callee's value set must override those of the supplied object.
-