All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.avaje.jsonb.jackson.NameCache Maven / Gradle / Ivy

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;
    });
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy