public class AvroWriters extends Object
AvroWriterFactory
instances for the different Avro types.Modifier and Type | Method and Description |
---|---|
static AvroWriterFactory<org.apache.avro.generic.GenericRecord> |
forGenericRecord(org.apache.avro.Schema schema)
Creates an
AvroWriterFactory that accepts and writes Avro generic types. |
static <T> AvroWriterFactory<T> |
forReflectRecord(Class<T> type)
Creates an
AvroWriterFactory for the given type. |
static <T extends org.apache.avro.specific.SpecificRecordBase> |
forSpecificRecord(Class<T> type)
Creates an
AvroWriterFactory for an Avro specific type. |
public static <T extends org.apache.avro.specific.SpecificRecordBase> AvroWriterFactory<T> forSpecificRecord(Class<T> type)
AvroWriterFactory
for an Avro specific type. The Avro writers will use the
schema of that specific type to build and write the records.type
- The class of the type to write.public static AvroWriterFactory<org.apache.avro.generic.GenericRecord> forGenericRecord(org.apache.avro.Schema schema)
AvroWriterFactory
that accepts and writes Avro generic types. The Avro
writers will use the given schema to build and write the records.schema
- The schema of the generic type.public static <T> AvroWriterFactory<T> forReflectRecord(Class<T> type)
AvroWriterFactory
for the given type. The Avro writers will use reflection
to create the schema for the type and use that schema to write the records.type
- The class of the type to write.Copyright © 2014–2024 The Apache Software Foundation. All rights reserved.