Class DefaultCacheProvider.Builder
java.lang.Object
com.fasterxml.jackson.databind.cfg.DefaultCacheProvider.Builder
- Enclosing class:
DefaultCacheProvider
Builder offering fluent factory methods to configure
DefaultCacheProvider
, keeping it immutable.-
Method Summary
Modifier and TypeMethodDescriptionbuild()
Constructs aDefaultCacheProvider
with the provided configuration values, using defaults where not specified.maxDeserializerCacheSize
(int maxDeserializerCacheSize) Define the maximum size of theLookupCache
instance constructed byDefaultCacheProvider.forDeserializerCache(DeserializationConfig)
andDefaultCacheProvider._buildCache(int)
.maxSerializerCacheSize
(int maxSerializerCacheSize) Define the maximum size of theLookupCache
instance constructed byDefaultCacheProvider.forSerializerCache(SerializationConfig)
andDefaultCacheProvider._buildCache(int)
maxTypeFactoryCacheSize
(int maxTypeFactoryCacheSize) Define the maximum size of theLookupCache
instance constructed byDefaultCacheProvider.forTypeFactory()
andDefaultCacheProvider._buildCache(int)
-
Method Details
-
maxDeserializerCacheSize
Define the maximum size of theLookupCache
instance constructed byDefaultCacheProvider.forDeserializerCache(DeserializationConfig)
andDefaultCacheProvider._buildCache(int)
.Note that specifying a maximum size of zero prevents values from being retained in the cache.
- Parameters:
maxDeserializerCacheSize
- Size for theLookupCache
to use withinDeserializerCache
- Returns:
- this builder
- Throws:
IllegalArgumentException
- ifmaxDeserializerCacheSize
is negative- Since:
- 2.16
-
maxSerializerCacheSize
Define the maximum size of theLookupCache
instance constructed byDefaultCacheProvider.forSerializerCache(SerializationConfig)
andDefaultCacheProvider._buildCache(int)
Note that specifying a maximum size of zero prevents values from being retained in the cache.
- Parameters:
maxSerializerCacheSize
- Size for theLookupCache
to use withinSerializerCache
- Returns:
- this builder
- Throws:
IllegalArgumentException
- ifmaxSerializerCacheSize
is negative- Since:
- 2.16
-
maxTypeFactoryCacheSize
Define the maximum size of theLookupCache
instance constructed byDefaultCacheProvider.forTypeFactory()
andDefaultCacheProvider._buildCache(int)
Note that specifying a maximum size of zero prevents values from being retained in the cache.
- Parameters:
maxTypeFactoryCacheSize
- Size for theLookupCache
to use withinTypeFactory
- Returns:
- this builder
- Throws:
IllegalArgumentException
- ifmaxTypeFactoryCacheSize
is negative
-
build
Constructs aDefaultCacheProvider
with the provided configuration values, using defaults where not specified.- Returns:
- A
DefaultCacheProvider
instance with the specified configuration
-