Class DefaultCacheProvider.Builder
- java.lang.Object
-
- com.fasterxml.jackson.databind.cfg.DefaultCacheProvider.Builder
-
- Enclosing class:
- DefaultCacheProvider
public static class DefaultCacheProvider.Builder extends java.lang.ObjectBuilder offering fluent factory methods to configureDefaultCacheProvider, keeping it immutable.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description DefaultCacheProviderbuild()Constructs aDefaultCacheProviderwith the provided configuration values, using defaults where not specified.DefaultCacheProvider.BuildermaxDeserializerCacheSize(int maxDeserializerCacheSize)Define the maximum size of theLookupCacheinstance constructed byDefaultCacheProvider.forDeserializerCache(DeserializationConfig)andDefaultCacheProvider._buildCache(int).DefaultCacheProvider.BuildermaxSerializerCacheSize(int maxSerializerCacheSize)Define the maximum size of theLookupCacheinstance constructed byDefaultCacheProvider.forSerializerCache(SerializationConfig)andDefaultCacheProvider._buildCache(int)DefaultCacheProvider.BuildermaxTypeFactoryCacheSize(int maxTypeFactoryCacheSize)Define the maximum size of theLookupCacheinstance constructed byDefaultCacheProvider.forTypeFactory()andDefaultCacheProvider._buildCache(int)
-
-
-
Method Detail
-
maxDeserializerCacheSize
public DefaultCacheProvider.Builder maxDeserializerCacheSize(int maxDeserializerCacheSize)
Define the maximum size of theLookupCacheinstance 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 theLookupCacheto use withinDeserializerCache- Returns:
- this builder
- Throws:
java.lang.IllegalArgumentException- ifmaxDeserializerCacheSizeis negative- Since:
- 2.16
-
maxSerializerCacheSize
public DefaultCacheProvider.Builder maxSerializerCacheSize(int maxSerializerCacheSize)
Define the maximum size of theLookupCacheinstance 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 theLookupCacheto use withinSerializerCache- Returns:
- this builder
- Throws:
java.lang.IllegalArgumentException- ifmaxSerializerCacheSizeis negative- Since:
- 2.16
-
maxTypeFactoryCacheSize
public DefaultCacheProvider.Builder maxTypeFactoryCacheSize(int maxTypeFactoryCacheSize)
Define the maximum size of theLookupCacheinstance 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 theLookupCacheto use withinTypeFactory- Returns:
- this builder
- Throws:
java.lang.IllegalArgumentException- ifmaxTypeFactoryCacheSizeis negative
-
build
public DefaultCacheProvider build()
Constructs aDefaultCacheProviderwith the provided configuration values, using defaults where not specified.- Returns:
- A
DefaultCacheProviderinstance with the specified configuration
-
-