public interface CacheService
Example
Services.get(CacheService.class).ifPresent(service -> {
Cache<String, String> cache = service.getCache("simpleCache");
cache.put("key", "value");
String value = cache.get("key");
});
Android Configuration: none
iOS Configuration: none
Modifier and Type | Method and Description |
---|---|
<K,V> Cache<K,V> |
getCache(java.lang.String cacheName)
Returns a
Cache instance. |
<K,V> Cache<K,V> getCache(java.lang.String cacheName)
Cache
instance. The name is used to allow for multiple cache instances to be created,
with the name being a unique identifier, returning the same cache every time when given the same name.K
- The key type for the cacheV
- The value type for the cachecacheName
- The name of the cache.Cache
instance.