com.fasterxml.jackson.databind.cfg

## Class DefaultCacheProvider.Builder

- java.lang.Object
- - com.fasterxml.jackson.databind.cfg.DefaultCacheProvider.Builder

Enclosing class:
  DefaultCacheProvider

    public static class DefaultCacheProvider.Builder
    extends Object

Builder offering fluent factory methods to configure `DefaultCacheProvider`, keeping it immutable.

### Method Summary

All Methods Instance Methods Concrete Methods
`DefaultCacheProvider` `build()` Constructs a `DefaultCacheProvider` with the provided configuration values, using defaults where not specified.
`DefaultCacheProvider.Builder` `maxDeserializerCacheSize(int maxDeserializerCacheSize)` Define the maximum size of the `LookupCache` instance constructed by `DefaultCacheProvider.forDeserializerCache(DeserializationConfig)` and `DefaultCacheProvider._buildCache(int)`.
`DefaultCacheProvider.Builder` `maxSerializerCacheSize(int maxSerializerCacheSize)` Define the maximum size of the `LookupCache` instance constructed by `DefaultCacheProvider.forSerializerCache(SerializationConfig)` and `DefaultCacheProvider._buildCache(int)`
`DefaultCacheProvider.Builder` `maxTypeFactoryCacheSize(int maxTypeFactoryCacheSize)` Define the maximum size of the `LookupCache` instance constructed by `DefaultCacheProvider.forTypeFactory()` and `DefaultCacheProvider._buildCache(int)`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Method Detail

#### maxDeserializerCacheSize

    public DefaultCacheProvider.Builder maxDeserializerCacheSize(int maxDeserializerCacheSize)

Define the maximum size of the `LookupCache` instance constructed by `DefaultCacheProvider.forDeserializerCache(DeserializationConfig)` and `DefaultCacheProvider._buildCache(int)`.

Note that specifying a maximum size of zero prevents values from being retained in the cache.

Parameters:
  `maxDeserializerCacheSize` - Size for the `LookupCache` to use within `DeserializerCache`
Returns:
  this builder
Throws:
  `IllegalArgumentException` - if `maxDeserializerCacheSize` is negative
Since:
  2.16

#### maxSerializerCacheSize

    public DefaultCacheProvider.Builder maxSerializerCacheSize(int maxSerializerCacheSize)

Define the maximum size of the `LookupCache` instance constructed by `DefaultCacheProvider.forSerializerCache(SerializationConfig)` and `DefaultCacheProvider._buildCache(int)`

Note that specifying a maximum size of zero prevents values from being retained in the cache.

Parameters:
  `maxSerializerCacheSize` - Size for the `LookupCache` to use within `SerializerCache`
Returns:
  this builder
Throws:
  `IllegalArgumentException` - if `maxSerializerCacheSize` is negative
Since:
  2.16

#### maxTypeFactoryCacheSize

    public DefaultCacheProvider.Builder maxTypeFactoryCacheSize(int maxTypeFactoryCacheSize)

Define the maximum size of the `LookupCache` instance constructed by `DefaultCacheProvider.forTypeFactory()` and `DefaultCacheProvider._buildCache(int)`

Note that specifying a maximum size of zero prevents values from being retained in the cache.

Parameters:
  `maxTypeFactoryCacheSize` - Size for the `LookupCache` to use within `TypeFactory`
Returns:
  this builder
Throws:
  `IllegalArgumentException` - if `maxTypeFactoryCacheSize` is negative

#### build

    public DefaultCacheProvider build()

Constructs a `DefaultCacheProvider` with the provided configuration values, using defaults where not specified.

Returns:
  A `DefaultCacheProvider` instance with the specified configuration