Package org.jdbi.v3.core.config.internal
Class ConfigCaches
- java.lang.Object
-
- org.jdbi.v3.core.config.internal.ConfigCaches
-
- All Implemented Interfaces:
JdbiConfig<ConfigCaches>
@Beta public final class ConfigCaches extends java.lang.Object implements JdbiConfig<ConfigCaches>
Hold metadata caches which maps various JVM constants into pre-parsed forms. For example, bean property accessors, or normalized enum constants. Note that unlike most JdbiConfig types, this cache is Jdbi level and shared, so it should not hold data that needs to respect reconfiguration. Additionally, currently there is no expiration policy, as nearly all keys are references to JVM constant pool entries. This makes it unsuitable as a general-purpose shared cache.
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.Map<ConfigCache<?,?>,java.util.Map<java.lang.Object,java.lang.Object>>caches
-
Constructor Summary
Constructors Constructor Description ConfigCaches()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description ConfigCachescreateCopy()Does not actually create a copy!!static <K,V>
ConfigCache<K,V>declare(java.util.function.BiFunction<ConfigRegistry,K,V> computer)static <K,V>
ConfigCache<K,V>declare(java.util.function.Function<K,?> keyNormalizer, java.util.function.BiFunction<ConfigRegistry,K,V> computer)static <K,V>
ConfigCache<K,V>declare(java.util.function.Function<K,?> keyNormalizer, java.util.function.Function<K,V> computer)static <K,V>
ConfigCache<K,V>declare(java.util.function.Function<K,V> computer)-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.jdbi.v3.core.config.JdbiConfig
setRegistry
-
-
-
-
Field Detail
-
caches
private final java.util.Map<ConfigCache<?,?>,java.util.Map<java.lang.Object,java.lang.Object>> caches
-
-
Method Detail
-
createCopy
public ConfigCaches createCopy()
Does not actually create a copy!!- Specified by:
createCopyin interfaceJdbiConfig<ConfigCaches>- Returns:
- a copy of this configuration object.
-
declare
public static <K,V> ConfigCache<K,V> declare(java.util.function.Function<K,V> computer)
-
declare
public static <K,V> ConfigCache<K,V> declare(java.util.function.Function<K,?> keyNormalizer, java.util.function.Function<K,V> computer)
-
declare
public static <K,V> ConfigCache<K,V> declare(java.util.function.BiFunction<ConfigRegistry,K,V> computer)
-
declare
public static <K,V> ConfigCache<K,V> declare(java.util.function.Function<K,?> keyNormalizer, java.util.function.BiFunction<ConfigRegistry,K,V> computer)
-
-