NullCacheStorage (FreeMarker 2.3.35 API)
Description: declaration: package: freemarker.cache, class: NullCacheStorage

Package freemarker.cache

# Class NullCacheStorage

java.lang.Object
freemarker.cache.NullCacheStorage

All Implemented Interfaces:
  `CacheStorage`, `CacheStorageWithGetSize`, `ConcurrentCacheStorage`

public class NullCacheStorage extends Object implements ConcurrentCacheStorage, CacheStorageWithGetSize
A cache storage that doesn't store anything. Use this if you don't want caching.

Since:
  2.3.17
See Also:
  `Configuration.setCacheStorage(CacheStorage)`

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `static NullCacheStorage`
  `INSTANCE`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `NullCacheStorage()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `clear()`
  `Object`
  `get​(Object key)`
  `int`
  `getSize()`
  Always returns 0.
  `boolean`
  `isConcurrent()`
  Returns true if this instance of cache storage is concurrently accessible from multiple threads without synchronization.
  `void`
  `put​(Object key, Object value)`
  `void`
  `remove​(Object key)`

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

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

- ## Field Details

  - ### INSTANCE

    public static final NullCacheStorage INSTANCE
    Since:
      2.3.22

- ## Constructor Details

  - ### NullCacheStorage

    public NullCacheStorage()

- ## Method Details

  - ### isConcurrent

    public boolean isConcurrent()
    Description copied from interface: `ConcurrentCacheStorage`
    Returns true if this instance of cache storage is concurrently accessible from multiple threads without synchronization.
    Specified by:
      `isConcurrent` in interface `ConcurrentCacheStorage`
    Returns:
      true if this instance of cache storage is concurrently accessible from multiple threads without synchronization.

  - ### get

    public Object get​(Object key)
    Specified by:
      `get` in interface `CacheStorage`

  - ### put

    public void put​(Object key, Object value)
    Specified by:
      `put` in interface `CacheStorage`

  - ### remove

    public void remove​(Object key)
    Specified by:
      `remove` in interface `CacheStorage`

  - ### clear

    public void clear()
    Specified by:
      `clear` in interface `CacheStorage`

  - ### getSize

    public int getSize()
    Always returns 0.
    Specified by:
      `getSize` in interface `CacheStorageWithGetSize`
    Since:
      2.3.21