java.lang.Object
tools.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 aDefaultCacheProviderwith the provided configuration values, using defaults where not specified.maxDeserializerCacheSize(int maxDeserializerCacheSize) Define the maximum size of theLookupCacheinstance constructed byDefaultCacheProvider.forDeserializerCache(DeserializationConfig)andDefaultCacheProvider._buildCache(int).maxSerializerCacheSize(int maxSerializerCacheSize) Define the maximum size of theLookupCacheinstance constructed byDefaultCacheProvider.forSerializerCache(SerializationConfig)andDefaultCacheProvider._buildCache(int)maxTypeFactoryCacheSize(int maxTypeFactoryCacheSize) Define the maximum size of theLookupCacheinstance constructed byDefaultCacheProvider.forTypeFactory()andDefaultCacheProvider._buildCache(int)
-
Method Details
-
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:
IllegalArgumentException- ifmaxDeserializerCacheSizeis negative
-
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:
IllegalArgumentException- ifmaxSerializerCacheSizeis negative
-
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:
IllegalArgumentException- ifmaxTypeFactoryCacheSizeis negative
-
build
Constructs aDefaultCacheProviderwith the provided configuration values, using defaults where not specified.- Returns:
- A
DefaultCacheProviderinstance with the specified configuration
-