K
- type of key.V
- type of value.public interface TransactionalMap<K,V>
A TransactionalMap is created by invoking getTransactionalMap
method. All operations performed on this map within a transaction boundary are invisible externally
until the point when the transaction commits. A commit usually succeeds in the absence of conflicts.
Modifier and Type | Method and Description |
---|---|
boolean |
containsKey(K key)
Returns true if this map contains a mapping for the specified key.
|
V |
get(K key)
Returns the value to which the specified key is mapped, or null if this
map contains no mapping for the key.
|
V |
put(K key,
V value)
Associates the specified value with the specified key in this map (optional operation).
|
V |
putIfAbsent(K key,
V value)
If the specified key is not already associated with a value
associates it with the given value and returns null, else returns the current value.
|
V |
remove(K key)
Removes the mapping for a key from this map if it is present (optional operation).
|
boolean |
remove(K key,
V value)
Removes the entry for the specified key only if it is currently
mapped to the specified value.
|
boolean |
replace(K key,
V oldValue,
V newValue)
Replaces the entry for the specified key only if currently mapped
to the specified value.
|
V get(K key)
key
- the key whose associated value is to be returnedboolean containsKey(K key)
key
- key whose presence in this map to be testedV put(K key, V value)
key
- key with which the specified value is to be associatedvalue
- value to be associated with the specified keyV remove(K key)
key
- key whose value is to be removed from the mapV putIfAbsent(K key, V value)
key
- key with which the specified value is to be associatedvalue
- value to be associated with the specified keyboolean remove(K key, V value)
key
- key with which the specified value is associatedvalue
- value expected to be associated with the specified keyboolean replace(K key, V oldValue, V newValue)
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 key