java.lang.Object
tools.jackson.databind.cfg.DefaultCacheProvider
- All Implemented Interfaces:
Serializable
,CacheProvider
The default implementation of
CacheProvider
.
Configuration is builder-based via DefaultCacheProvider.Builder
.
Users can either use this class or create their own CacheProvider
implementation.
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
Builder offering fluent factory methods to configureDefaultCacheProvider
, keeping it immutable. -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final int
Maximum size of theLookupCache
instance constructed byforDeserializerCache(DeserializationConfig)
.protected final int
Maximum size of theLookupCache
instance constructed byforSerializerCache(SerializationConfig)
protected final int
Maximum size of theLookupCache
instance constructed byforTypeFactory()
. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
DefaultCacheProvider
(int maxDeserializerCacheSize, int maxSerializerCacheSize, int maxTypeFactoryCacheSize) -
Method Summary
Modifier and TypeMethodDescriptionprotected <K,
V> LookupCache<K, V> _buildCache
(int maxSize) static DefaultCacheProvider.Builder
builder()
static CacheProvider
Method to provide aLookupCache
instance for constructingDeserializerCache
.Method to provide aLookupCache
instance for constructingSerializerCache
.Method to provide aLookupCache
instance for constructingTypeFactory
.
-
Field Details
-
_maxDeserializerCacheSize
protected final int _maxDeserializerCacheSizeMaximum size of theLookupCache
instance constructed byforDeserializerCache(DeserializationConfig)
. -
_maxSerializerCacheSize
protected final int _maxSerializerCacheSizeMaximum size of theLookupCache
instance constructed byforSerializerCache(SerializationConfig)
-
_maxTypeFactoryCacheSize
protected final int _maxTypeFactoryCacheSizeMaximum size of theLookupCache
instance constructed byforTypeFactory()
.
-
-
Constructor Details
-
DefaultCacheProvider
protected DefaultCacheProvider(int maxDeserializerCacheSize, int maxSerializerCacheSize, int maxTypeFactoryCacheSize)
-
-
Method Details
-
defaultInstance
- Returns:
- Default
DefaultCacheProvider
instance using default configuration values.
-
forDeserializerCache
public LookupCache<JavaType,ValueDeserializer<Object>> forDeserializerCache(DeserializationConfig config) Method to provide aLookupCache
instance for constructingDeserializerCache
.- Specified by:
forDeserializerCache
in interfaceCacheProvider
- Returns:
LookupCache
instance for constructingDeserializerCache
.
-
forSerializerCache
Description copied from interface:CacheProvider
Method to provide aLookupCache
instance for constructingSerializerCache
.- Specified by:
forSerializerCache
in interfaceCacheProvider
- Returns:
LookupCache
instance for constructingSerializerCache
.
-
forTypeFactory
Description copied from interface:CacheProvider
Method to provide aLookupCache
instance for constructingTypeFactory
.- Specified by:
forTypeFactory
in interfaceCacheProvider
- Returns:
LookupCache
instance for constructingTypeFactory
.
-
_buildCache
-
builder
- Returns:
DefaultCacheProvider.Builder
instance for configuration.
-