public class DeserializerStringCache
extends java.lang.Object
implements java.util.function.Function<java.lang.String,java.lang.String>
String.intern()
and StringCache
that works with Jackson's DeserializationContext. Definitely NOT thread-safe,
intended to avoid the costs associated with thread synchronization and
short-lived heap allocations (e.g., Strings)Modifier and Type | Class and Description |
---|---|
static class |
DeserializerStringCache.CacheScope |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
apply(com.netflix.discovery.util.DeserializerStringCache.CharBuffer charValue)
returns a String that may be interned at app-scope to reduce heap
consumption
|
java.lang.String |
apply(com.netflix.discovery.util.DeserializerStringCache.CharBuffer charValue,
DeserializerStringCache.CacheScope cacheScope)
returns a object of type T that may be interned at the specified scope to
reduce heap consumption
|
java.lang.String |
apply(com.fasterxml.jackson.core.JsonParser jp)
returns a String read from the JsonParser argument's current position.
|
java.lang.String |
apply(com.fasterxml.jackson.core.JsonParser jp,
DeserializerStringCache.CacheScope cacheScope) |
java.lang.String |
apply(com.fasterxml.jackson.core.JsonParser jp,
DeserializerStringCache.CacheScope cacheScope,
java.util.function.Supplier<java.lang.String> source)
returns a String read from the JsonParser argument's current position.
|
java.lang.String |
apply(java.lang.String stringValue)
returns a String that may be interned at the app-scope to reduce heap
consumption
|
java.lang.String |
apply(java.lang.String stringValue,
DeserializerStringCache.CacheScope cacheScope)
returns a String that may be interned at the given scope to reduce heap
consumption
|
static void |
clear(com.fasterxml.jackson.databind.DeserializationContext context)
clears app-scoped cache entries from the specified DeserializationContext
|
static void |
clear(com.fasterxml.jackson.databind.DeserializationContext context,
DeserializerStringCache.CacheScope scope)
clears cache entries in the given scope from the specified
DeserializationContext.
|
static void |
clear(com.fasterxml.jackson.databind.ObjectReader reader)
clears app-scoped cache entries from the specified ObjectReader
|
static void |
clear(com.fasterxml.jackson.databind.ObjectReader reader,
DeserializerStringCache.CacheScope scope)
clears cache entries in the given scope from the specified ObjectReader.
|
static DeserializerStringCache |
from(com.fasterxml.jackson.databind.DeserializationContext context)
extracts a DeserializerStringCache from the DeserializationContext
|
static com.fasterxml.jackson.databind.ObjectReader |
init(com.fasterxml.jackson.databind.ObjectReader reader)
adds a new DeserializerStringCache to the passed-in ObjectReader
|
static com.fasterxml.jackson.databind.ObjectReader |
init(com.fasterxml.jackson.databind.ObjectReader reader,
com.fasterxml.jackson.databind.DeserializationContext context)
adds an existing DeserializerStringCache from the DeserializationContext
to an ObjectReader
|
com.fasterxml.jackson.databind.ObjectReader |
initReader(com.fasterxml.jackson.databind.ObjectReader reader) |
int |
size() |
public static com.fasterxml.jackson.databind.ObjectReader init(com.fasterxml.jackson.databind.ObjectReader reader)
reader
- public static com.fasterxml.jackson.databind.ObjectReader init(com.fasterxml.jackson.databind.ObjectReader reader, com.fasterxml.jackson.databind.DeserializationContext context)
reader
- a new ObjectReadercontext
- an existing DeserializationContext containing a
DeserializerStringCachepublic static DeserializerStringCache from(com.fasterxml.jackson.databind.DeserializationContext context)
context
- an existing DeserializationContext containing a
DeserializerStringCachepublic static void clear(com.fasterxml.jackson.databind.ObjectReader reader)
reader
- public static void clear(com.fasterxml.jackson.databind.ObjectReader reader, DeserializerStringCache.CacheScope scope)
reader
- scope
- public static void clear(com.fasterxml.jackson.databind.DeserializationContext context)
context
- public static void clear(com.fasterxml.jackson.databind.DeserializationContext context, DeserializerStringCache.CacheScope scope)
context
- scope
- public com.fasterxml.jackson.databind.ObjectReader initReader(com.fasterxml.jackson.databind.ObjectReader reader)
public java.lang.String apply(com.fasterxml.jackson.core.JsonParser jp) throws java.io.IOException
jp
- java.io.IOException
public java.lang.String apply(com.fasterxml.jackson.core.JsonParser jp, DeserializerStringCache.CacheScope cacheScope) throws java.io.IOException
java.io.IOException
public java.lang.String apply(com.fasterxml.jackson.core.JsonParser jp, DeserializerStringCache.CacheScope cacheScope, java.util.function.Supplier<java.lang.String> source) throws java.io.IOException
jp
- cacheScope
- java.io.IOException
public java.lang.String apply(com.netflix.discovery.util.DeserializerStringCache.CharBuffer charValue)
charValue
- public java.lang.String apply(com.netflix.discovery.util.DeserializerStringCache.CharBuffer charValue, DeserializerStringCache.CacheScope cacheScope)
charValue
- cacheScope
- trabsform
- public java.lang.String apply(java.lang.String stringValue)
apply
in interface java.util.function.Function<java.lang.String,java.lang.String>
stringValue
- public java.lang.String apply(java.lang.String stringValue, DeserializerStringCache.CacheScope cacheScope)
stringValue
- cacheScope
- public int size()