Class NamedWriteableRegistry

java.lang.Object
org.elasticsearch.common.io.stream.NamedWriteableRegistry

public class NamedWriteableRegistry extends Object
A registry for Writeable.Reader readers of NamedWriteable. The registration is keyed by the combination of the category class of NamedWriteable, and a name unique to that category.
  • Constructor Details

  • Method Details

    • getReader

      public <T> Writeable.Reader<? extends T> getReader(Class<T> categoryClass, String name)
      Returns a reader for a NamedWriteable object identified by the name provided as argument and its category.
    • getReader

      public static <T> Writeable.Reader<? extends T> getReader(Class<T> categoryClass, String name, Map<String,Writeable.Reader<?>> readers)
      Parameters:
      categoryClass - category of the reader
      name - name of the writeable
      readers - map of readers for the category
      Returns:
      reader for the named writable of the given name
    • getReaders

      public <T> Map<String,Writeable.Reader<?>> getReaders(Class<T> categoryClass)
      Gets the readers map keyed by name for the given category
      Parameters:
      categoryClass - category to get readers map for
      Returns:
      map of readers for the category