T - The type to be serialized.@Internal public final class AvroFactory<T> extends Object
DatumReader and DatumWriter.| 限定符和类型 | 方法和说明 |
|---|---|
static <T> org.apache.avro.Schema |
extractAvroSpecificSchema(Class<T> type,
org.apache.avro.specific.SpecificData specificData)
Extracts an Avro
Schema from a SpecificRecord. |
static <T extends org.apache.avro.specific.SpecificData> |
getSpecificDataForClass(Class<T> type,
ClassLoader cl)
Creates a
SpecificData object for a given class. |
public static <T> org.apache.avro.Schema extractAvroSpecificSchema(Class<T> type, org.apache.avro.specific.SpecificData specificData)
Schema from a SpecificRecord. We do this either via SpecificData or by instantiating a record and extracting the schema from the instance.public static <T extends org.apache.avro.specific.SpecificData> org.apache.avro.specific.SpecificData getSpecificDataForClass(Class<T> type, ClassLoader cl)
SpecificData object for a given class. Possibly uses the specific data from
the generated class with logical conversions applied (avro >= 1.9.x).
Copied over from SpecificData#getForClass(Class<T> c) we do not use the method
directly, because we want to be API backwards compatible with older Avro versions which did
not have this method
Copyright © 2014–2023 The Apache Software Foundation. All rights reserved.