public class DefaultCacheProvider extends Object implements CacheProvider
CacheProvider
.
Configuration is builder-based via DefaultCacheProvider.Builder
.
Users can either use this class or create their own CacheProvider
implementation.
Modifier and Type | Class and Description |
---|---|
static class |
DefaultCacheProvider.Builder
Builder offering fluent factory methods to configure
DefaultCacheProvider , keeping it immutable. |
Modifier and Type | Field and Description |
---|---|
protected int |
_maxDeserializerCacheSize
Maximum size of the
LookupCache instance constructed by forDeserializerCache(DeserializationConfig) . |
protected int |
_maxSerializerCacheSize
Maximum size of the
LookupCache instance constructed by forSerializerCache(SerializationConfig) |
protected int |
_maxTypeFactoryCacheSize
Maximum size of the
LookupCache instance constructed by forTypeFactory() . |
Modifier | Constructor and Description |
---|---|
protected |
DefaultCacheProvider(int maxDeserializerCacheSize,
int maxSerializerCacheSize,
int maxTypeFactoryCacheSize) |
Modifier and Type | Method and Description |
---|---|
protected <K,V> LookupCache<K,V> |
_buildCache(int maxSize) |
static DefaultCacheProvider.Builder |
builder() |
static CacheProvider |
defaultInstance() |
LookupCache<JavaType,JsonDeserializer<Object>> |
forDeserializerCache(DeserializationConfig config)
Method to provide a
LookupCache instance for constructing DeserializerCache . |
LookupCache<TypeKey,JsonSerializer<Object>> |
forSerializerCache(SerializationConfig config)
Method for constructing a
LookupCache instance to be used by
SerializerCache . |
LookupCache<Object,JavaType> |
forTypeFactory()
Method for constructing a
LookupCache instance to be used by
TypeFactory . |
protected final int _maxDeserializerCacheSize
LookupCache
instance constructed by forDeserializerCache(DeserializationConfig)
.protected final int _maxSerializerCacheSize
LookupCache
instance constructed by forSerializerCache(SerializationConfig)
protected final int _maxTypeFactoryCacheSize
LookupCache
instance constructed by forTypeFactory()
.protected DefaultCacheProvider(int maxDeserializerCacheSize, int maxSerializerCacheSize, int maxTypeFactoryCacheSize)
public static CacheProvider defaultInstance()
DefaultCacheProvider
instance using default configuration values.public LookupCache<JavaType,JsonDeserializer<Object>> forDeserializerCache(DeserializationConfig config)
LookupCache
instance for constructing DeserializerCache
.
Implementation should match DeserializerCache(int)
.forDeserializerCache
in interface CacheProvider
LookupCache
instance for constructing DeserializerCache
.public LookupCache<TypeKey,JsonSerializer<Object>> forSerializerCache(SerializationConfig config)
CacheProvider
LookupCache
instance to be used by
SerializerCache
.forSerializerCache
in interface CacheProvider
LookupCache
instance for constructing SerializerCache
.public LookupCache<Object,JavaType> forTypeFactory()
CacheProvider
LookupCache
instance to be used by
TypeFactory
.forTypeFactory
in interface CacheProvider
LookupCache
instance for constructing TypeFactory
.protected <K,V> LookupCache<K,V> _buildCache(int maxSize)
public static DefaultCacheProvider.Builder builder()
DefaultCacheProvider.Builder
instance for configuration.Copyright © 2008–2023 FasterXML. All rights reserved.