public interface AvroService extends org.apache.avro.message.SchemaStore
AvroSchemaFactoryContext
.Modifier and Type | Method and Description |
---|---|
void |
addSchema(org.apache.avro.Schema schema)
Registers the schema into the SchemaStore.
|
<D> org.apache.avro.Schema |
createSchema(D input)
Creates the Avro schema from an object.
An AvroSchemaFactory handling the object class has to be implemented and registered to the AvroComponent.. |
String |
decodeName(String input)
Decodes a valid Avro name to its actual value.
|
String |
encodeName(String input)
Encodes a name for it to be eligible to Avro limitations (alphanumeric and _).
By default Nuxeo can encode - and : Other replacements can be registered to the AvroComponent. |
<D,M> D |
fromAvro(org.apache.avro.Schema schema,
Class<D> clazz,
M object)
Map an Avro data to an instance of the given class.
An AvroMapper handling the given class has to be implemented and registered to the AvroComponent.. |
<D,M> M |
toAvro(org.apache.avro.Schema schema,
D input)
Map an object to an Avro data.
An AvroMapper handling the given class has to be implemented and registered. |
void addSchema(org.apache.avro.Schema schema)
schema
- to be registered<D> org.apache.avro.Schema createSchema(D input)
input
- any objectString decodeName(String input)
input
- the name to decodeString encodeName(String input)
input
- the name to encode<D,M> D fromAvro(org.apache.avro.Schema schema, Class<D> clazz, M object)
schema
- the Avro schemaclazz
- the class to map the Avro object toobject
- the Avro data<D,M> M toAvro(org.apache.avro.Schema schema, D input)
schema
- the Avro schemainput
- the object to map to an Avro dataCopyright © 2018 Nuxeo. All rights reserved.