Package org.nuxeo.runtime.avro
Interface AvroService
- All Known Implementing Classes:
AvroServiceImpl
public interface AvroService
This service allows to create a
AvroSchemaFactoryContext.- Since:
- 10.2
-
Method Summary
Modifier and TypeMethodDescription<D> org.apache.avro.SchemacreateSchema(D input) Creates the Avro schema from an object.
An AvroSchemaFactory handling the object class has to be implemented and registered to the AvroComponent..decodeName(String input) Decodes a valid Avro name to its actual value.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 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..Gets the Schema store<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.
-
Method Details
-
getSchemaStore
AvroSchemaStore getSchemaStore()Gets the Schema store- Since:
- 10.3
-
createSchema
<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..- Parameters:
input- any object- Returns:
- the Avro schema
-
decodeName
Decodes a valid Avro name to its actual value.- Parameters:
input- the name to decode- Returns:
- the decoded name
-
encodeName
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.- Parameters:
input- the name to encode- Returns:
- the encoded name
-
fromAvro
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..- Parameters:
schema- the Avro schemaclazz- the class to map the Avro object toobject- the Avro data- Returns:
- an instance of the given class
-
toAvro
<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.- Parameters:
schema- the Avro schemainput- the object to map to an Avro data- Returns:
- the Avro data
-