|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.avro.generic.GenericData
public class GenericData
Utilities for generic Java data.
Nested Class Summary | |
---|---|
static class |
GenericData.Array<T>
Default implementation of GenericArray . |
static class |
GenericData.Fixed
|
static class |
GenericData.Record
Default implementation of GenericRecord . |
Constructor Summary | |
---|---|
protected |
GenericData()
|
Method Summary | |
---|---|
int |
compare(Object o1,
Object o2,
Schema s)
Compare objects according to their schema. |
static GenericData |
get()
Return the singleton instance. |
protected Schema |
getRecordSchema(Object record)
Called to obtain the schema of a record. |
Schema |
induce(Object datum)
Create a schema given an example datum. |
protected boolean |
instanceOf(Schema schema,
Object datum)
Called by resolveUnion(Schema,Object) . |
protected boolean |
isArray(Object datum)
Called by the default implementation of instanceOf(org.apache.avro.Schema, java.lang.Object) . |
protected boolean |
isBytes(Object datum)
Called by the default implementation of instanceOf(org.apache.avro.Schema, java.lang.Object) . |
protected boolean |
isEnum(Object datum)
Called by the default implementation of instanceOf(org.apache.avro.Schema, java.lang.Object) . |
protected boolean |
isFixed(Object datum)
Called by the default implementation of instanceOf(org.apache.avro.Schema, java.lang.Object) . |
protected boolean |
isMap(Object datum)
Called by the default implementation of instanceOf(org.apache.avro.Schema, java.lang.Object) . |
protected boolean |
isRecord(Object datum)
Called by the default implementation of instanceOf(org.apache.avro.Schema, java.lang.Object) . |
protected boolean |
isString(Object datum)
Called by the default implementation of instanceOf(org.apache.avro.Schema, java.lang.Object) . |
int |
resolveUnion(Schema union,
Object datum)
Return the index for a datum within a union. |
String |
toString(Object datum)
Renders a Java datum as JSON. |
boolean |
validate(Schema schema,
Object datum)
Returns true if a Java datum matches a schema. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
protected GenericData()
Method Detail |
---|
public static GenericData get()
public boolean validate(Schema schema, Object datum)
public String toString(Object datum)
public Schema induce(Object datum)
public int resolveUnion(Schema union, Object datum)
instanceOf(Schema,Object)
.
protected boolean instanceOf(Schema schema, Object datum)
resolveUnion(Schema,Object)
. May be overridden for
alternate data representations.
protected boolean isArray(Object datum)
instanceOf(org.apache.avro.Schema, java.lang.Object)
.
protected boolean isRecord(Object datum)
instanceOf(org.apache.avro.Schema, java.lang.Object)
.
protected Schema getRecordSchema(Object record)
protected boolean isEnum(Object datum)
instanceOf(org.apache.avro.Schema, java.lang.Object)
.
protected boolean isMap(Object datum)
instanceOf(org.apache.avro.Schema, java.lang.Object)
.
protected boolean isFixed(Object datum)
instanceOf(org.apache.avro.Schema, java.lang.Object)
.
protected boolean isString(Object datum)
instanceOf(org.apache.avro.Schema, java.lang.Object)
.
protected boolean isBytes(Object datum)
instanceOf(org.apache.avro.Schema, java.lang.Object)
.
public int compare(Object o1, Object o2, Schema s)
BinaryData.compare(byte[], int, byte[], int, Schema)
.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |