- All Superinterfaces:
Serializable
This component provides the capability to store data so future requests for that data can be served faster and accessed from
every
InputTypeResolver, TypeKeysResolver and OutputTypeResolver- Since:
- 1.0
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescription<T extends Serializable>
TcomputeIfAbsent(Serializable key, MetadataCache.MetadataCacheValueResolver mappingFunction) If the specified key is not already associated with a value, attempts to compute its value using the given mapping function and enters it into this map unlessnull.<T extends Serializable>
Optional<T>get(Serializable key) voidput(Serializable key, Serializable value) Associates the specified value with the specified key in the cache. if the cache previously contained a mapping for the specified key, the old value gets replacedvoidputAll(Map<? extends Serializable, ? extends Serializable> values) Copies all of the entries from the specified map to the cache.
-
Method Details
-
put
Associates the specified value with the specified key in the cache. if the cache previously contained a mapping for the specified key, the old value gets replaced- Parameters:
key- a key to associate the specified valuevalue- the value to persist in the cache
-
putAll
Copies all of the entries from the specified map to the cache.- Parameters:
values- values to be stored in the cache
-
get
- Parameters:
key- the key whose associated value is to be returned- Returns:
- the value to which the specified key is mapped, or
Option.empty()if this map contains no value for the specified key.
-
computeIfAbsent
<T extends Serializable> T computeIfAbsent(Serializable key, MetadataCache.MetadataCacheValueResolver mappingFunction) throws org.mule.runtime.api.metadata.MetadataResolvingException, org.mule.runtime.api.connection.ConnectionException If the specified key is not already associated with a value, attempts to compute its value using the given mapping function and enters it into this map unlessnull.- Parameters:
key- the key whose associated value is to be returned- Returns:
- the current (existing or computed) value associated with the specified key, or null if the computed value is null
- Throws:
org.mule.runtime.api.metadata.MetadataResolvingExceptionorg.mule.runtime.api.connection.ConnectionException
-