|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.avro.generic.GenericData org.apache.avro.specific.SpecificData
public class SpecificData
Utilities for generated Java classes and interfaces.
Nested Class Summary | |
---|---|
static interface |
SpecificData.SchemaConstructable
Tag interface that indicates that a class has a one-argument constructor that accepts a Schema. |
Nested classes/interfaces inherited from class org.apache.avro.generic.GenericData |
---|
GenericData.Array<T>, GenericData.EnumSymbol, GenericData.Fixed, GenericData.Record, GenericData.StringType |
Field Summary |
---|
Fields inherited from class org.apache.avro.generic.GenericData |
---|
STRING_PROP, STRING_TYPE_STRING |
Constructor Summary | |
---|---|
protected |
SpecificData()
For subclasses. |
|
SpecificData(ClassLoader classLoader)
Construct with a specific classloader. |
Method Summary | |
---|---|
protected int |
compare(Object o1,
Object o2,
Schema s,
boolean eq)
Comparison implementation. |
Object |
createFixed(Object old,
Schema schema)
Called to create an fixed value. |
protected Schema |
createSchema(Type type,
Map<String,Schema> names)
Create the schema for a Java type. |
static SpecificData |
get()
Return the singleton instance. |
Class |
getClass(Schema schema)
Return the class that implements a schema, or null if none exists. |
static String |
getClassName(Schema schema)
Returns the Java class name indicated by a schema's name and namespace. |
protected Schema |
getEnumSchema(Object datum)
Called to obtain the schema of a enum. |
Protocol |
getProtocol(Class iface)
Return the protocol for a Java interface. |
Schema |
getSchema(Type type)
Find the schema for a Java type. |
protected boolean |
isEnum(Object datum)
Called by the default implementation of GenericData.instanceOf(org.apache.avro.Schema, java.lang.Object) . |
static Object |
newInstance(Class c,
Schema s)
Create an instance of a class. |
Object |
newRecord(Object old,
Schema schema)
Called to create new record instances. |
Methods inherited from class org.apache.avro.generic.GenericData |
---|
compare, createFixed, deepCopy, getField, getField, getFixedSchema, getRecordSchema, getRecordState, getSchemaName, hashCode, hashCodeAdd, induce, instanceOf, isArray, isBytes, isFixed, isMap, isRecord, isString, resolveUnion, setField, setField, setStringType, toString, toString, validate |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
protected SpecificData()
get()
.
public SpecificData(ClassLoader classLoader)
Method Detail |
---|
public static SpecificData get()
protected boolean isEnum(Object datum)
GenericData
GenericData.instanceOf(org.apache.avro.Schema, java.lang.Object)
.
isEnum
in class GenericData
protected Schema getEnumSchema(Object datum)
GenericData
getEnumSchema
in class GenericData
public Class getClass(Schema schema)
public static String getClassName(Schema schema)
public Schema getSchema(Type type)
protected Schema createSchema(Type type, Map<String,Schema> names)
public Protocol getProtocol(Class iface)
protected int compare(Object o1, Object o2, Schema s, boolean eq)
GenericData
compare
in class GenericData
public static Object newInstance(Class c, Schema s)
SpecificData.SchemaConstructable
, call a constructor with a Schema
parameter, otherwise use a no-arg constructor.
public Object createFixed(Object old, Schema schema)
GenericData
GenericFixed
.
createFixed
in class GenericData
public Object newRecord(Object old, Schema schema)
GenericData
GenericData.Record
.
newRecord
in class GenericData
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |