Builder

class Builder

Constructors

Link copied to clipboard
constructor()

Functions

Link copied to clipboard

Create a new MemoryCache instance.

Link copied to clipboard

Set the maximum size of the memory cache in bytes.

Link copied to clipboard
fun maxSizePercent(context: PlatformContext, percent: Double = context.defaultMemoryCacheSizePercent()): MemoryCache.Builder

Set the maximum size of the memory cache as a percentage of this application's available memory.

Link copied to clipboard

Enables/disables strong reference tracking of values added to this memory cache.

Link copied to clipboard

Enables/disables weak reference tracking of values added to this memory cache. Weak references do not contribute to the current size of the memory cache. This ensures that if a Value hasn't been garbage collected yet it will be returned from the memory cache.