Class ObservableMap<K,V>
java.lang.Object
org.springframework.statemachine.support.ObservableMap<K,V>
- Type Parameters:
K- the type of keyV- the type of value
- All Implemented Interfaces:
Map<K,V>
Utility class which wraps
Map and notifies
ObservableMap.MapChangeListener of changes for individual
change operations.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceThe listener interface for receiving map change events. -
Constructor Summary
ConstructorsConstructorDescriptionInstantiates a new observable map.ObservableMap(Map<K, V> map, ObservableMap.MapChangeListener<K, V> listener) Instantiates a new observable map. -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()booleancontainsKey(Object key) booleancontainsValue(Object value) entrySet()booleanGets the delegating map instance.inthashCode()booleanisEmpty()keySet()voidvoidsetDelegate(Map<K, V> delegate) Sets the delegate.voidsetListener(ObservableMap.MapChangeListener<K, V> listener) Sets the map change listener.intsize()toString()values()Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.Map
compute, computeIfAbsent, computeIfPresent, forEach, getOrDefault, merge, putIfAbsent, remove, replace, replace, replaceAll
-
Constructor Details
-
ObservableMap
public ObservableMap()Instantiates a new observable map. -
ObservableMap
Instantiates a new observable map.- Parameters:
map- the delegating maplistener- the map change listener
-
-
Method Details
-
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
-
toString
-
getDelegate
Gets the delegating map instance.- Returns:
- the delegate
-
setDelegate
Sets the delegate.- Parameters:
delegate- the delegate
-
setListener
Sets the map change listener.- Parameters:
listener- the listener
-
hashCode
public int hashCode() -
equals
-