configureCache

Configures the Factory cache. The function must be called before the cache is initialized (i.e., before any call to the to method) and should be called once. Example:

configureCache {
maximumItems = 100
expirationTime = 2
expirationTimeUnit = TimeUnit.HOURS
}

val rounding = Rounding.to(2)

Parameters

config

A configuration block to set up the cache.

Throws

When the cache was previously initialized or configured.