Interface RenderingCacheService<T extends java.io.Serializable>
-
- All Known Implementing Classes:
DefaultRenderingCacheService
public interface RenderingCacheService<T extends java.io.Serializable>Service to cacheItemModeldata representation for rendering. The type T can be represented by any Data or Model type.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description booleancacheEnabled()Verifies whether the cache is enabled or not.TcacheOrElse(ItemModel item, java.util.function.Supplier<T> converter)Methods takes theItemModel, verifies that theSerializablerepresentation is cached and returns it.java.util.Optional<T>get(CacheKey key)Returns cachedSerializable.java.util.Optional<CacheKey>getKey(ItemModel item)Retrieves the key that must be used to cacheSerializable.voidput(CacheKey key, T item)Puts theSerializableinto the cache using provided key.
-
-
-
Method Detail
-
cacheEnabled
boolean cacheEnabled()
Verifies whether the cache is enabled or not.- Returns:
- true if cache is enabled, false otherwise
-
get
java.util.Optional<T> get(CacheKey key)
Returns cachedSerializable.- Parameters:
key- the key used to retrieve cachedSerializable- Returns:
- optional cached
Serializable.
-
put
void put(CacheKey key, T item)
Puts theSerializableinto the cache using provided key.- Parameters:
key- the key used to saveSerializableitem- theSerializablethat must be cached.
-
getKey
java.util.Optional<CacheKey> getKey(ItemModel item)
Retrieves the key that must be used to cacheSerializable. The key is retrieved byItemModel.- Parameters:
item- theItemModelfor which to retrieve the key.- Returns:
- the key
-
-