Package org.nuxeo.runtime.avro
Interface AvroService
-
- All Known Implementing Classes:
AvroServiceImpl
public interface AvroService
This service allows to create aAvroSchemaFactoryContext
.- Since:
- 10.2
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description <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>
DfromAvro(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..AvroSchemaStore
getSchemaStore()
Gets the Schema store<D,M>
MtoAvro(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 Detail
-
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
String decodeName(String input)
Decodes a valid Avro name to its actual value.- Parameters:
input
- the name to decode- Returns:
- the decoded name
-
encodeName
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.- Parameters:
input
- the name to encode- Returns:
- the encoded name
-
fromAvro
<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..- 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
-
-