Class DefaultCacheProvider
java.lang.Object
com.fasterxml.jackson.databind.cfg.DefaultCacheProvider
- All Implemented Interfaces:
CacheProvider, Serializable
The default implementation of
CacheProvider.
Configuration is builder-based via DefaultCacheProvider.Builder.
Users can either use this class or create their own CacheProvider implementation.
- Since:
- 2.16
- 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 for constructing aLookupCacheinstance to be used bySerializerCache.Method for constructing aLookupCacheinstance to be used byTypeFactory.
-
Field Details
-
_maxDeserializerCacheSize
protected final int _maxDeserializerCacheSizeMaximum size of theLookupCacheinstance constructed byforDeserializerCache(DeserializationConfig).- See Also:
-
_maxSerializerCacheSize
protected final int _maxSerializerCacheSizeMaximum size of theLookupCacheinstance constructed byforSerializerCache(SerializationConfig)- See Also:
-
_maxTypeFactoryCacheSize
protected final int _maxTypeFactoryCacheSizeMaximum size of theLookupCacheinstance constructed byforTypeFactory().- See Also:
-
-
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, JsonDeserializer<Object>> forDeserializerCache(DeserializationConfig config) Method to provide aLookupCacheinstance for constructingDeserializerCache. Implementation should matchDeserializerCache(int).- Specified by:
forDeserializerCachein interfaceCacheProvider- Returns:
LookupCacheinstance for constructingDeserializerCache.
-
forSerializerCache
Description copied from interface:CacheProviderMethod for constructing aLookupCacheinstance to be used bySerializerCache.- Specified by:
forSerializerCachein interfaceCacheProvider- Returns:
LookupCacheinstance for constructingSerializerCache.
-
forTypeFactory
Description copied from interface:CacheProviderMethod for constructing aLookupCacheinstance to be used byTypeFactory.- Specified by:
forTypeFactoryin interfaceCacheProvider- Returns:
LookupCacheinstance for constructingTypeFactory.
-
_buildCache
-
builder
- Returns:
DefaultCacheProvider.Builderinstance for configuration.
-