Class DefaultCacheProvider.Builder
- java.lang.Object
-
- com.fasterxml.jackson.databind.cfg.DefaultCacheProvider.Builder
-
- Enclosing class:
- DefaultCacheProvider
public static class DefaultCacheProvider.Builder extends java.lang.Object
Builder offering fluent factory methods to configureDefaultCacheProvider
, keeping it immutable.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description DefaultCacheProvider
build()
Constructs aDefaultCacheProvider
with the provided configuration values, using defaults where not specified.DefaultCacheProvider.Builder
maxDeserializerCacheSize(int maxDeserializerCacheSize)
Define the maximum size of theLookupCache
instance constructed byDefaultCacheProvider.forDeserializerCache(DeserializationConfig)
andDefaultCacheProvider._buildCache(int)
.DefaultCacheProvider.Builder
maxSerializerCacheSize(int maxSerializerCacheSize)
Define the maximum size of theLookupCache
instance constructed byDefaultCacheProvider.forSerializerCache(SerializationConfig)
andDefaultCacheProvider._buildCache(int)
DefaultCacheProvider.Builder
maxTypeFactoryCacheSize(int maxTypeFactoryCacheSize)
Define the maximum size of theLookupCache
instance constructed byDefaultCacheProvider.forTypeFactory()
andDefaultCacheProvider._buildCache(int)
-
-
-
Method Detail
-
maxDeserializerCacheSize
public DefaultCacheProvider.Builder maxDeserializerCacheSize(int 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:
java.lang.IllegalArgumentException
- ifmaxDeserializerCacheSize
is negative- Since:
- 2.16
-
maxSerializerCacheSize
public DefaultCacheProvider.Builder maxSerializerCacheSize(int 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:
java.lang.IllegalArgumentException
- ifmaxSerializerCacheSize
is negative- Since:
- 2.16
-
maxTypeFactoryCacheSize
public DefaultCacheProvider.Builder maxTypeFactoryCacheSize(int 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:
java.lang.IllegalArgumentException
- ifmaxTypeFactoryCacheSize
is negative
-
build
public DefaultCacheProvider build()
Constructs aDefaultCacheProvider
with the provided configuration values, using defaults where not specified.- Returns:
- A
DefaultCacheProvider
instance with the specified configuration
-
-