Interface Store<T>
-
- Type Parameters:
T- resource
public interface Store<T>Store is a generic object storage interface. Reflector knows how to watch a server and update a store. A generic store is provided, which allows Reflector to be used as a local caching system, and an Least Recently Used store, which allows Reflector to work like a queue of items yet to be processed. It makes no assumptions about the stored object identity; it is the responsibility of a Store implementation to provide a mechanism to correctly key objects and to define the contract for obtaining objects by some arbitrary key type. This is ported from official go client: https://github.com/kubernetes/client-go/blob/master/tools/cache/store.go
Refactored to only expose read methods
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Tget(T object)Returns the requested item.TgetByKey(String key)Returns the request item with specific key.StringgetKey(T object)Use the key function to extract the object's key.List<T>list()Returns a list of all the items.List<String>listKeys()returns a list of all keys of the object currently in the store.
-
-
-
Method Detail
-
listKeys
List<String> listKeys()
returns a list of all keys of the object currently in the store.- Returns:
- list of all keys
-
get
T get(T object)
Returns the requested item.- Parameters:
object- object- Returns:
- requested item if exists.
-
getByKey
T getByKey(String key)
Returns the request item with specific key.- Parameters:
key- specific key- Returns:
- the requested item
-
-