Package org.ehcache.spi.persistence
Interface StateHolder<K,V>
- Type Parameters:
K- type of KeysV- type of Values
public interface StateHolder<K,V>
A
Map like structure that can hold key value mappings.-
Method Summary
Modifier and TypeMethodDescriptionentrySet()Retrieves all the entries in theStateHolderas aSetofMap.Entryinstances.Retrieves the value mapped to the givenkeyputIfAbsent(K key, V value) If the specified key is not already associated with a value (or is mapped tonull) associates it with the given value and returnsnull, else returns the current value.booleanRemoves the entry for a key only if currently mapped to a given value.
-
Method Details
-
putIfAbsent
If the specified key is not already associated with a value (or is mapped tonull) associates it with the given value and returnsnull, else returns the current value.- Parameters:
key- a keyvalue- a value- Returns:
- the previous value associated with the specified key, or
nullif there was no mapping for the key.
-
get
Retrieves the value mapped to the givenkey- Parameters:
key- a key- Returns:
- the value mapped to the key
-
remove
Removes the entry for a key only if currently mapped to a given value.- Parameters:
key- a key with which the specified value is associatedvalue- value expected to be associated with the specified key- Returns:
trueif the value was removed
-
entrySet
Retrieves all the entries in theStateHolderas aSetofMap.Entryinstances.- Returns:
- the set of this
StateHoldermappings
-