Class AvroSerializerProviders
- java.lang.Object
-
- com.azure.core.experimental.serializer.AvroSerializerProviders
-
public final class AvroSerializerProviders extends Object
Service Provider Interface (SPI) proxy forAvroSerializerProvider
.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static AvroSerializer
createInstance(String schema)
Creates an Avro serializer instance based using the firstAvroSerializerProvider
found on the classpath.static String
getSchema(Object object)
Returns the Avro schema for specified object.static String
getSchemaName(Object object)
Returns the Avro schema for specified object.
-
-
-
Method Detail
-
createInstance
public static AvroSerializer createInstance(String schema)
Creates an Avro serializer instance based using the firstAvroSerializerProvider
found on the classpath.- Parameters:
schema
- Schema tied to the Avro serializer for its lifetime.- Returns:
- A new
AvroSerializer
instance tied to the passed schema.
-
getSchema
public static String getSchema(Object object)
Returns the Avro schema for specified object.- Parameters:
object
- The object having its Avro schema retrieved.- Returns:
- The Avro schema for the object.
- Throws:
IllegalArgumentException
- If the object is an unsupported type.
-
getSchemaName
public static String getSchemaName(Object object)
Returns the Avro schema for specified object.- Parameters:
object
- The object having its Avro schema name retrieved.- Returns:
- The Avro schema name for the object.
- Throws:
IllegalArgumentException
- If the object is an unsupported type.
-
-