Package cx.syndeo.scripting.entities
Interface SyndeoCache
public interface SyndeoCache
Provides access to the string-based key/value Syndeo cache.
A common use is to persist temporary data across different conversations, such as caching
of OAuth tokens for an external service invocations.
Implementations provide storage, retrieval, existence check, and removal of entries by key.
-
Method Summary
Modifier and TypeMethodDescriptionbooleanRemoves the entry for the given key from the cache.Retrieves the value associated with the given key.booleanChecks whether the cache contains an entry for the given key.voidStores or updates the value for the given key.
-
Method Details
-
get
Retrieves the value associated with the given key.- Parameters:
key_p- the cache key- Returns:
- the value if present, or
nullif the key is missing
-
set
Stores or updates the value for the given key.- Parameters:
key_p- the cache keyvalue_p- the value to associate with the key
-
has
Checks whether the cache contains an entry for the given key.- Parameters:
key_p- the cache key- Returns:
trueif the key exists in the cache,falseotherwise
-
destroy
Removes the entry for the given key from the cache.- Parameters:
key_p- the cache key- Returns:
trueif an entry was present and removed,falseif the key was not found
-