configureCache

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

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

val usd = Currency of "USD"

Parameters

config

A configuration block to set up the cache.

Throws

When the cache was previously initialized or configured.