Package org.cyclos.impl.utils
Interface Storage<K,V,P extends Function<K,V>,R extends BiPredicate<K,V>>
-
- All Known Subinterfaces:
LocalStorage<K,V>,SharedStorage<K,V>
- All Known Implementing Classes:
GuavaLocalStorage,GuavaSharedStorage,GuavaStorage,HazelcastSharedStorage
public interface Storage<K,V,P extends Function<K,V>,R extends BiPredicate<K,V>>Represents a volatile key / value store. The values set always have an associated expiration timeout.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidclear()Removes all keysVget(K key)Returns the value associated with the given key, or null if expired.Set<K>keys(R test)Returns all the keys that match the given predicate.voidremove(K key)Removes the given key.voidremoveAll(Collection<K> keys)Removes all the given keys.voidremoveIf(R test)Removes all the values that matches against the given predicatevoidset(K key, V value)Adds a value to the store
-
-
-
Method Detail
-
clear
void clear()
Removes all keys
-
keys
Set<K> keys(R test)
Returns all the keys that match the given predicate. The resulting set is NOT backed by the actual storage.
-
remove
void remove(K key)
Removes the given key.
-
removeAll
void removeAll(Collection<K> keys)
Removes all the given keys.
-
removeIf
void removeIf(R test)
Removes all the values that matches against the given predicate
-
-