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 classBuilder offering fluent factory methods to configureDefaultCacheProvider, keeping it immutable. -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final intMaximum size of theLookupCacheinstance constructed byforDeserializerCache(DeserializationConfig).protected final intMaximum size of theLookupCacheinstance constructed byforSerializerCache(SerializationConfig)protected final intMaximum size of theLookupCacheinstance constructed byforTypeFactory(). -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedDefaultCacheProvider(int maxDeserializerCacheSize, int maxSerializerCacheSize, int maxTypeFactoryCacheSize) -
Method Summary
Modifier and TypeMethodDescriptionprotected <K,V> LookupCache<K, V> _buildCache(int maxSize) static DefaultCacheProvider.Builderbuilder()static CacheProviderMethod to provide aLookupCacheinstance for constructingDeserializerCache.Method to provide aLookupCacheinstance for constructingSerializerCache.Method to provide aLookupCacheinstance for constructingTypeFactory.
-
Field Details
-
_maxDeserializerCacheSize
protected final int _maxDeserializerCacheSizeMaximum size of theLookupCacheinstance constructed byforDeserializerCache(DeserializationConfig). -
_maxSerializerCacheSize
protected final int _maxSerializerCacheSizeMaximum size of theLookupCacheinstance constructed byforSerializerCache(SerializationConfig) -
_maxTypeFactoryCacheSize
protected final int _maxTypeFactoryCacheSizeMaximum size of theLookupCacheinstance constructed byforTypeFactory().
-
-
Constructor Details
-
DefaultCacheProvider
protected DefaultCacheProvider(int maxDeserializerCacheSize, int maxSerializerCacheSize, int maxTypeFactoryCacheSize)
-
-
Method Details
-
defaultInstance
- Returns:
- Default
DefaultCacheProviderinstance using default configuration values.
-
forDeserializerCache
public LookupCache<JavaType,ValueDeserializer<Object>> forDeserializerCache(DeserializationConfig config) Method to provide aLookupCacheinstance for constructingDeserializerCache.- Specified by:
forDeserializerCachein interfaceCacheProvider- Returns:
LookupCacheinstance for constructingDeserializerCache.
-
forSerializerCache
Description copied from interface:CacheProviderMethod to provide aLookupCacheinstance for constructingSerializerCache.- Specified by:
forSerializerCachein interfaceCacheProvider- Returns:
LookupCacheinstance for constructingSerializerCache.
-
forTypeFactory
Description copied from interface:CacheProviderMethod to provide aLookupCacheinstance for constructingTypeFactory.- Specified by:
forTypeFactoryin interfaceCacheProvider- Returns:
LookupCacheinstance for constructingTypeFactory.
-
_buildCache
-
builder
- Returns:
DefaultCacheProvider.Builderinstance for configuration.
-