public class SimpleCache<K, V>
extends Object
implements Cache
Thin adapter that exposes CommonCache through the internal Cache API.
K - the key typeV - the value type| Constructor and description |
|---|
SimpleCache(int limit, CacheType type)Creates a cache with the supplied size limit and eviction policy. |
SimpleCache(int limit)Creates an LRU cache with the supplied size limit. |
| Type Params | Return Type | Name and description |
|---|---|---|
|
public V |
get(K key){@inheritDoc} |
|
public V |
getSilent(K key){@inheritDoc} |
|
public void |
put(K key, V value){@inheritDoc} |
|
public void |
remove(K key){@inheritDoc} |
|
public int |
size()Returns the current number of cached entries.
|
|
public String |
toString()Returns the underlying cache state as a string. |
Creates a cache with the supplied size limit and eviction policy.
limit - the maximum number of entriestype - the eviction strategyCreates an LRU cache with the supplied size limit.
limit - the maximum number of entries{@inheritDoc}
{@inheritDoc}
{@inheritDoc}
{@inheritDoc}
Returns the current number of cached entries.
Returns the underlying cache state as a string.
Copyright © 2003-2026 The Apache Software Foundation. All rights reserved.