io.avaje.jsonb.jackson.NameCache Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of avaje-jsonb-jackson Show documentation
Show all versions of avaje-jsonb-jackson Show documentation
jackson adapter for avaje-jsonb
The newest version!
package io.avaje.jsonb.jackson;
import com.fasterxml.jackson.core.io.SerializedString;
import java.util.concurrent.ConcurrentHashMap;
final class NameCache {
private final ConcurrentHashMap keys = new ConcurrentHashMap<>();
SerializedString get(String name) {
return keys.computeIfAbsent(name, _name -> {
SerializedString val = new SerializedString(_name);
val.asQuotedUTF8();
return val;
});
}
}