JexlCache (Apache Commons JEXL 3.6.3 API)
Description: declaration: package: org.apache.commons.jexl3, interface: JexlCache

Package org.apache.commons.jexl3

# Interface JexlCache<K,V>

Type Parameters:
  `K` - source
  `V` - script or template

public interface JexlCache<K,V>
Caching script or template interface.

- ## Nested Class Summary

  Nested Classes
  Modifier and Type
  Interface
  Description
  `static interface`
  `JexlCache.Reference`
  A cached reference.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `int`
  `capacity()`
  Returns the cache capacity, the maximum number of elements it can contain.
  `void`
  `clear()`
  Clears the cache.
  `default Collection<Map.Entry<K,V>>`
  `entries()`
  Produces the cache entry set.
  `V`
  `get(K key)`
  Gets a value from this cache.
  `V`
  `put(K key, V script)`
  Puts a value in this cache.
  `int`
  `size()`
  Returns the cache size, the actual number of elements it contains.

- ## Method Details

  - ### 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 Collection<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 this cache.
    Parameters:
      `key` - the cache entry key
    Returns:
      the cache entry value

  - ### put

    V put(K key, V script)
    Puts a value in this cache.
    Parameters:
      `key` - the cache entry key
      `script` - 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