PerpetualCache

open class PerpetualCache(allowedCache: Set<CacheIds>, yde: YDEImpl) : Cache(source)

This is the implementation of the Cache interface that uses a Map to store and retrieve data.

Inheritors

Constructors

Link copied to clipboard
constructor(allowedCache: Set<CacheIds>, yde: YDEImpl)

Functions

Link copied to clipboard
open override fun clear()

Clears the cache

open override fun clear(cacheId: CacheIds)

Clears the cache of a certain cache Id.

Link copied to clipboard
open override fun contains(key: String): Boolean

Check's if this properties exists in the cache

open override fun contains(key: String, cacheId: CacheIds): Boolean

Check's if this properties exists in the cache and value exists

Link copied to clipboard
open operator override fun get(key: String, cacheId: CacheIds): Any?

Gets an item from the cache

Link copied to clipboard
open override fun getOrPut(key: String, value: Any, cacheId: CacheIds): Any

Gets an item from the cache but adds it if it doesn't exist

Link copied to clipboard
open override fun remove(key: String, cacheId: CacheIds): Any?

Removes an item from the cache

Link copied to clipboard
open operator override fun set(key: String, value: Any, cacheId: CacheIds)

Adds a new item to the cache

Link copied to clipboard
open override fun triggerCacheClear(duration: Duration, repeat: Boolean)

Triggers a thread to clear the entire cache after a certain amount of time

Link copied to clipboard
open override fun triggerCacheTypeClear(cacheId: CacheIds, duration: Duration, repeat: Boolean)

Triggers a thread to clear a certain cache type after a certain amount of time

Link copied to clipboard
open override fun triggerCacheTypesClear(cacheIds: List<CacheIds>, duration: Duration, repeat: Boolean)

Triggers a thread to clear a list of cache types after a certain amount of time

Link copied to clipboard
open override fun values(cacheId: CacheIds): List<Any>

Gets a list of objects in the cache

Properties

Link copied to clipboard
open override val size: Int

The size of the cache