public class NamedWriteableRegistry
extends java.lang.Object
NamedWriteable
objects. Allows to register and retrieve prototype instances of writeable objects
given their name.Constructor and Description |
---|
NamedWriteableRegistry() |
Modifier and Type | Method and Description |
---|---|
<T> Writeable.Reader<? extends T> |
getReader(java.lang.Class<T> categoryClass,
java.lang.String name)
Returns a prototype of the
NamedWriteable object identified by the name provided as argument and its category |
<T extends NamedWriteable> |
register(java.lang.Class<T> categoryClass,
java.lang.String name,
Writeable.Reader<? extends T> reader)
Register a
NamedWriteable given its category, its name, and a function to read it from the stream. |
<T extends NamedWriteable> |
registerPrototype(java.lang.Class<T> categoryClass,
NamedWriteable<? extends T> namedWriteable)
Deprecated.
|
public <T extends NamedWriteable> void register(java.lang.Class<T> categoryClass, java.lang.String name, Writeable.Reader<? extends T> reader)
NamedWriteable
given its category, its name, and a function to read it from the stream.
This method suppresses the rawtypes warning because it intentionally using NamedWriteable instead of NamedWriteable<T>
so it
is easier to use and because we might be able to drop the type parameter from NamedWriteable entirely some day.@Deprecated public <T extends NamedWriteable> void registerPrototype(java.lang.Class<T> categoryClass, NamedWriteable<? extends T> namedWriteable)
register(Class, String, org.elasticsearch.common.io.stream.Writeable.Reader)
NamedWriteable
prototype given its category.public <T> Writeable.Reader<? extends T> getReader(java.lang.Class<T> categoryClass, java.lang.String name)
NamedWriteable
object identified by the name provided as argument and its category