Interface FunctionCache
- All Known Implementing Classes:
MapFunctionCache
public interface FunctionCache
A contract that provides caching of a function object from a repository based on a unique name.
- Since:
- 1.0.0
- Author:
- Przemek Hertel
-
Method Summary
Modifier and TypeMethodDescriptionReturns a function with a defined namefunctionNameornull, if function does not exist at cache.voidEvicts all functions from a cachevoidinvalidate(String functionName) Evicts functionfunctionNamefrom a cachelist()Returs all cache entries as snapshot.voidInserts a functionfunctionunder a keyfunctionName.void
-
Method Details
-
put
Inserts a functionfunctionunder a keyfunctionName.- Parameters:
functionName- unique function name, used as a key for a cachefunction- function from a reposiotry
-
putAll
-
get
Returns a function with a defined namefunctionNameornull, if function does not exist at cache.- Parameters:
functionName- name of a function- Returns:
- function from a cache
-
invalidate
Evicts functionfunctionNamefrom a cache- Parameters:
functionName- name of a function
-
invalidate
void invalidate()Evicts all functions from a cache -
list
List<CacheEntry<Function>> list()Returs all cache entries as snapshot. All modification to this snapshot will not modify cache state.- Returns:
- all cache entries as snapshot
-