public final class TypesafeConfigurator extends Object
CaffeineConfiguration entries using the
Typesafe Config library.| Modifier and Type | Method and Description |
|---|---|
static <K,V> CaffeineConfiguration<K,V> |
defaults(Config config)
Retrieves the default cache settings from the configuration resource.
|
static <K,V> Optional<CaffeineConfiguration<K,V>> |
from(Config config,
String cacheName)
Retrieves the cache's settings from the configuration resource if defined.
|
static void |
setFactoryCreator(FactoryCreator factoryCreator)
Specifies how
Factory instances are created for a given class name. |
public static <K,V> CaffeineConfiguration<K,V> defaults(Config config)
K - the type of keys maintained the cacheV - the type of cached valuesconfig - the configuration resourcepublic static <K,V> Optional<CaffeineConfiguration<K,V>> from(Config config, String cacheName)
K - the type of keys maintained the cacheV - the type of cached valuesconfig - the configuration resourcecacheName - the name of the cache@Inject public static void setFactoryCreator(FactoryCreator factoryCreator)
Factory instances are created for a given class name. The default
strategy uses Class.newInstance() and requires the class has a no-args constructor.factoryCreator - the strategy for creating a factory