com.opensymphony.xwork2.ognl

## Class OgnlDefaultCache<Key,Value>

- java.lang.Object
- - com.opensymphony.xwork2.ognl.OgnlDefaultCache<Key,Value>

- Type Parameters:
    `Key` - The type for the cache key entries
    `Value` - The type for the cache value entries
  All Implemented Interfaces:
    OgnlCache<Key,Value>

      public class OgnlDefaultCache<Key,Value>
      extends Object
      implements OgnlCache<Key,Value>

  Default OGNL cache implementation. Setting a very high eviction limit simulates an unlimited cache. Setting too low an eviction limit will make the cache ineffective.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `OgnlDefaultCache(int evictionLimit, int initialCapacity, float loadFactor)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `clear()`
    `Value` | `get(Key key)`
    `int` | `getEvictionLimit()`
    `void` | `put(Key key, Value value)`
    `void` | `putIfAbsent(Key key, Value value)`
    `void` | `setEvictionLimit(int cacheEvictionLimit)`
    `int` | `size()`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### OgnlDefaultCache

          public OgnlDefaultCache(int evictionLimit,
                                  int initialCapacity,
                                  float loadFactor)

  - ### Method Detail

    - #### get

          public Value get(Key key)

      Specified by:
        `get` in interface `OgnlCache<Key,Value>`

    - #### put

          public void put(Key key,
                          Value value)

      Specified by:
        `put` in interface `OgnlCache<Key,Value>`

    - #### putIfAbsent

          public void putIfAbsent(Key key,
                                  Value value)

      Specified by:
        `putIfAbsent` in interface `OgnlCache<Key,Value>`

    - #### size

          public int size()

      Specified by:
        `size` in interface `OgnlCache<Key,Value>`

    - #### clear

          public void clear()

      Specified by:
        `clear` in interface `OgnlCache<Key,Value>`

    - #### getEvictionLimit

          public int getEvictionLimit()

      Specified by:
        `getEvictionLimit` in interface `OgnlCache<Key,Value>`

    - #### setEvictionLimit

          public void setEvictionLimit(int cacheEvictionLimit)

      Specified by:
        `setEvictionLimit` in interface `OgnlCache<Key,Value>`

Copyright © 2000–2023 Apache Software Foundation. All rights reserved.