Package org.apache.commons.jexl3
Interface JexlCache<K,V>
-
- Type Parameters:
K- sourceV- script or template
- All Known Implementing Classes:
SoftCache
public interface JexlCache<K,V>Caching scripts or templates interface.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interfaceJexlCache.ReferenceA cached reference.
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description intcapacity()Returns the cache capacity, the maximum number of elements it can contain.voidclear()Clears the cache.default java.util.Collection<java.util.Map.Entry<K,V>>entries()Produces the cache entry set.Vget(K key)Gets a value from cache.Vput(K key, V script)Puts a value in cache.intsize()Returns the cache size, the actual number of elements it contains.
-
-
-
Method Detail
-
capacity
int capacity()
Returns the cache capacity, the maximum number of elements it can contain.- Returns:
- the cache capacity
-
clear
void clear()
Clears the cache.
-
entries
default java.util.Collection<java.util.Map.Entry<K,V>> entries()
Produces the cache entry set.For implementations testing only
- Returns:
- the cache entry list
-
get
V get(K key)
Gets a value from cache.- Parameters:
key- the cache entry key- Returns:
- the cache entry value
-
put
V put(K key, V script)
Puts a value in cache.- Parameters:
key- the cache entry keyscript- the cache entry value- Returns:
- the previously associated value if any
-
size
int size()
Returns the cache size, the actual number of elements it contains.- Returns:
- the cache size
-
-