Package com.floragunn.codova.config.net
Class CacheConfig
- java.lang.Object
-
- com.floragunn.codova.config.net.CacheConfig
-
- All Implemented Interfaces:
Document<CacheConfig>
public class CacheConfig extends Object implements Document<CacheConfig>
-
-
Field Summary
Fields Modifier and Type Field Description static CacheConfigDEFAULTstatic CacheConfigOFF
-
Constructor Summary
Constructors Constructor Description CacheConfig(boolean enabled, Duration expireAfterWrite, Duration expireAfterAccess, Integer maxSize)CacheConfig(DocNode config, Parser.Context context, Optional<CacheConfig> defaultValue)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <K,V>
com.google.common.cache.Cache<K,V>build()<K,V>
com.google.common.cache.Cache<K,V>buildWithStats()DurationgetExpireAfterAccess()DurationgetExpireAfterWrite()IntegergetMaxSize()booleanisEnabled()ObjecttoBasicObject()StringtoString()-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface com.floragunn.codova.documents.Document
meta, toBytes, toDeepBasicObject, toDocNode, toJsonString, toPrettyJsonString, toSmile, toString, toYamlString
-
-
-
-
Field Detail
-
OFF
public static CacheConfig OFF
-
DEFAULT
public static CacheConfig DEFAULT
-
-
Constructor Detail
-
CacheConfig
public CacheConfig(boolean enabled, Duration expireAfterWrite, Duration expireAfterAccess, Integer maxSize)
-
CacheConfig
public CacheConfig(DocNode config, Parser.Context context, Optional<CacheConfig> defaultValue) throws ConfigValidationException
- Throws:
ConfigValidationException
-
-
Method Detail
-
toBasicObject
public Object toBasicObject()
- Specified by:
toBasicObjectin interfaceDocument<CacheConfig>
-
build
public <K,V> com.google.common.cache.Cache<K,V> build()
-
buildWithStats
public <K,V> com.google.common.cache.Cache<K,V> buildWithStats()
-
getExpireAfterWrite
public Duration getExpireAfterWrite()
-
getExpireAfterAccess
public Duration getExpireAfterAccess()
-
getMaxSize
public Integer getMaxSize()
-
isEnabled
public boolean isEnabled()
-
-