org.apache.avro.specific
Class SpecificData

java.lang.Object
  extended by org.apache.avro.generic.GenericData
      extended by org.apache.avro.reflect.ReflectData
          extended by org.apache.avro.specific.SpecificData

public class SpecificData
extends ReflectData

Utilities for generated Java classes and interfaces.


Nested Class Summary
 
Nested classes/interfaces inherited from class org.apache.avro.reflect.ReflectData
ReflectData.AllowNull
 
Nested classes/interfaces inherited from class org.apache.avro.generic.GenericData
GenericData.Array<T>, GenericData.Fixed, GenericData.Record
 
Constructor Summary
protected SpecificData()
           
 
Method Summary
 int compare(Object o1, Object o2, Schema s)
          Compare objects according to their schema.
protected  Schema createSchema(Type type, Map<String,Schema> names)
          Create a schema for a type and it's fields.
static SpecificData get()
          Return the singleton instance.
protected  Schema getRecordSchema(Object record)
          Called to obtain the schema of a record.
protected  boolean isRecord(Object datum)
          Called by the default implementation of GenericData.instanceOf(org.apache.avro.Schema, java.lang.Object).
 
Methods inherited from class org.apache.avro.reflect.ReflectData
createFieldSchema, getClass, getClassName, getProtocol, getSchema, isEnum, validate
 
Methods inherited from class org.apache.avro.generic.GenericData
induce, instanceOf, isArray, isBytes, isFixed, isMap, isString, resolveUnion, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SpecificData

protected SpecificData()
Method Detail

get

public static SpecificData get()
Return the singleton instance.


createSchema

protected Schema createSchema(Type type,
                              Map<String,Schema> names)
Description copied from class: ReflectData
Create a schema for a type and it's fields. Note that by design only fields of the direct class, not it's super classes, are used for creating the schema. Also, fields are not permitted to be null.

Overrides:
createSchema in class ReflectData

isRecord

protected boolean isRecord(Object datum)
Description copied from class: GenericData
Called by the default implementation of GenericData.instanceOf(org.apache.avro.Schema, java.lang.Object).

Overrides:
isRecord in class ReflectData

getRecordSchema

protected Schema getRecordSchema(Object record)
Description copied from class: GenericData
Called to obtain the schema of a record. By default calls {GenericRecord#getSchema(). May be overridden for alternate record representations.

Overrides:
getRecordSchema in class ReflectData

compare

public int compare(Object o1,
                   Object o2,
                   Schema s)
Description copied from class: GenericData
Compare objects according to their schema. If equal, return zero. If greater-than, return 1, if less than return -1. Order is consistent with that of BinaryData.compare(byte[], int, byte[], int, Schema).

Overrides:
compare in class GenericData


Copyright © 2009 The Apache Software Foundation