Class DefaultCacheProvider.Builder
java.lang.Object
tools.jackson.databind.cfg.DefaultCacheProvider.Builder
- Enclosing class:
DefaultCacheProvider
Builder offering fluent factory methods to configure
DefaultCacheProvider, keeping it immutable.-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate intMaximum Size of theLookupCacheinstance created byDefaultCacheProvider.forDeserializerCache(DeserializationConfig).private intMaximum Size of theLookupCacheinstance created byDefaultCacheProvider.forSerializerCache(SerializationConfig)Corresponds toDefaultCacheProvider._maxSerializerCacheSize.private intMaximum Size of theLookupCacheinstance created byDefaultCacheProvider.forTypeFactory(). -
Constructor Summary
Constructors -
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)
-
Field Details
-
_maxDeserializerCacheSize
private int _maxDeserializerCacheSizeMaximum Size of theLookupCacheinstance created byDefaultCacheProvider.forDeserializerCache(DeserializationConfig). Corresponds toDefaultCacheProvider._maxDeserializerCacheSize. -
_maxSerializerCacheSize
private int _maxSerializerCacheSizeMaximum Size of theLookupCacheinstance created byDefaultCacheProvider.forSerializerCache(SerializationConfig)Corresponds toDefaultCacheProvider._maxSerializerCacheSize. -
_maxTypeFactoryCacheSize
private int _maxTypeFactoryCacheSizeMaximum Size of theLookupCacheinstance created byDefaultCacheProvider.forTypeFactory(). Corresponds toDefaultCacheProvider._maxTypeFactoryCacheSize.
-
-
Constructor Details
-
Builder
Builder()
-
-
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
-