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

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

The newest version!
package io.avaje.jsonb.jackson;

import com.fasterxml.jackson.core.io.SerializedString;
import io.avaje.jsonb.spi.PropertyNames;

final class JacksonNames implements PropertyNames {

  static final JacksonNames EMPTY = new JacksonNames(new String[0]);

  private static final NameCache NAME_CACHE = new NameCache();

  private final SerializedString[] keys;

  JacksonNames(String[] names) {
    keys = new SerializedString[names.length];
    for (int i = 0; i < names.length; i++) {
      keys[i] = obtain(names[i]);
    }
  }

  SerializedString key(int pos) {
    return keys[pos];
  }

  private static SerializedString obtain(String name) {
    return NAME_CACHE.get(name);
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy