Interface StepCache<K,V>
- Type Parameters:
K- Key typeV- Value type
- All Superinterfaces:
AutoCloseable,Closeable
A StepCache is a Map-like data structure that provides temporary storage of application data.
- Since:
- 2.0.0
-
Method Summary
Modifier and TypeMethodDescriptionvoidclear()Removes all the entries of the StepCache.voidclose()Closes the StepCache.booleancontainsKey(K key) Determines if the StepCache contains the key.Returns the value of the key from the StepCache, or null if the StepCache contains no value for the key.booleanisClosed()Determines whether this StepCache instance has been closed.voidStores the entry into the StepCache.booleanDeletes an entry from the StepCache by the key.
-
Method Details
-
get
Returns the value of the key from the StepCache, or null if the StepCache contains no value for the key.- Parameters:
key- the key- Returns:
- the cached value; or null if contains no value for the key
-
containsKey
Determines if the StepCache contains the key.- Parameters:
key- the key- Returns:
- true if contains the key
-
put
Stores the entry into the StepCache.- Parameters:
key- the keyvalue- the value to be cached
-
remove
Deletes an entry from the StepCache by the key.- Parameters:
key- the key- Returns:
- returns false if don't contains the key
-
clear
void clear()Removes all the entries of the StepCache. -
close
void close()Closes the StepCache.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable
-
isClosed
boolean isClosed()Determines whether this StepCache instance has been closed.- Returns:
- true if this StepCache is closed; false if it is still open
-