Package org.nuxeo.runtime.avro
Class AvroSchemaFactoryContext
- java.lang.Object
-
- org.nuxeo.runtime.avro.AvroSchemaFactoryContext
-
public class AvroSchemaFactoryContext extends Object
An AvroSchemaFactoryContext represents a context in which Avro schemas are cached and reused depending on their qualified name.
Avro does not permit to declare twice a schema with the same qualified name. Thus a schema has to be fully described the first time it appears in the object, and then be referred by name.- Since:
- 10.2
-
-
Field Summary
Fields Modifier and Type Field Description protected Map<String,org.apache.avro.Schema>createdSchemasprotected Map<Class<?>,AvroSchemaFactory<?>>factoriesprotected AvroServiceservice
-
Constructor Summary
Constructors Modifier Constructor Description protectedAvroSchemaFactoryContext(AvroService service)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <T> org.apache.avro.SchemacreateSchema(T input)protected <T> AvroSchemaFactory<T>getFactory(T input)AvroServicegetService()protected voidregister(Class<?> type, AvroSchemaFactory<?> factory)<U> List<U>sort(Collection<U> children)
-
-
-
Field Detail
-
factories
protected final Map<Class<?>,AvroSchemaFactory<?>> factories
-
service
protected final AvroService service
-
-
Constructor Detail
-
AvroSchemaFactoryContext
protected AvroSchemaFactoryContext(AvroService service)
-
-
Method Detail
-
createSchema
public <T> org.apache.avro.Schema createSchema(T input)
-
getService
public AvroService getService()
-
sort
public <U> List<U> sort(Collection<U> children)
-
getFactory
protected <T> AvroSchemaFactory<T> getFactory(T input)
-
register
protected void register(Class<?> type, AvroSchemaFactory<?> factory)
-
-