Class 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()  
    • Field Detail

      • caches

        private final java.util.Map<ConfigCache<?,​?>,​java.util.Map<java.lang.Object,​java.lang.Object>> caches
    • Constructor Detail

      • ConfigCaches

        public ConfigCaches()
    • Method Detail

      • 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)