Module org.elasticsearch.server
Class NamedWriteableRegistry
java.lang.Object
org.elasticsearch.common.io.stream.NamedWriteableRegistry
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.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classAn entry in the registry, made up of a category class and name, and a reader for that category class. -
Constructor Summary
ConstructorsConstructorDescriptionConstructs a new registry from the given entries. -
Method Summary
Modifier and TypeMethodDescription<T> Writeable.Reader<? extends T> Returns a reader for aNamedWriteableobject identified by the name provided as argument and its category.static <T> Writeable.Reader<? extends T> <T> Map<String, Writeable.Reader<?>> getReaders(Class<T> categoryClass) Gets the readers map keyed by name for the given categorybooleanhasReaders(Class<?> categoryClass)
-
Constructor Details
-
NamedWriteableRegistry
Constructs a new registry from the given entries.
-
-
Method Details
-
getReader
Returns a reader for aNamedWriteableobject 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 readername- name of the writeablereaders- map of readers for the category- Returns:
- reader for the named writable of the given
name
-
getReaders
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
-
hasReaders
-