public interface MetadataCacheStorage
MetadataCacheStorageSerializers available in the MetadataCacheStorageFactoryContext when executing
MetadataCacheStorageFactory.createMetadataCache(MetadataCacheStorageFactoryContext);
In case serializers are used, implementations should follow this rule:
If a value was serialized to be stored put(String, Object),
it should be deserialized when returned get(String)
That means that, weather or not the value was serialized, the following should always be true:
storage.put("KEY", object);
Object retrievedObject = storage.get("KEY").get();
assert object.getClass().isAssignableFrom(retrievedObject.class) == true
| Modifier and Type | Method and Description |
|---|---|
<V> Optional<V> |
get(String key)
Get the value from the cache associated with the key
|
Set<String> |
getAllKeys() |
<V> V |
put(String key,
V value)
Add the value related with this key to the cache
|
void |
remove(String... keys)
Remove the values associated with the keys provided from the cache
|
<V> Optional<V> get(String key)
key - the key used to identify the value in the storageOptional with the value stored or Optional.empty() if none found.<V> V put(String key, V value)
key - the key to use to locate the valuevalue - the value to be storedvoid remove(String... keys)
keys - the keys to locate the values to removeCopyright © 2020 MuleSoft, Inc.. All rights reserved.