org.apache.avro.thrift

## Class ThriftData

- java.lang.Object
- - org.apache.avro.generic.GenericData
  - - org.apache.avro.thrift.ThriftData

    public class ThriftData
    extends org.apache.avro.generic.GenericData

Utilities for serializing Thrift data in Avro format.

### Nested Class Summary

### Nested classes/interfaces inherited from class org.apache.avro.generic.GenericData

`org.apache.avro.generic.GenericData.Array<T>, org.apache.avro.generic.GenericData.EnumSymbol, org.apache.avro.generic.GenericData.Fixed, org.apache.avro.generic.GenericData.InstanceSupplier, org.apache.avro.generic.GenericData.Record, org.apache.avro.generic.GenericData.StringType`

### Field Summary

### Fields inherited from class org.apache.avro.generic.GenericData

`FAST_READER_PROP, STRING_PROP, STRING_TYPE_STRING`

### Constructor Summary

Constructors
`protected` `ThriftData()`

### Method Summary

All Methods Static Methods Instance Methods Concrete Methods
`org.apache.avro.io.DatumReader` `createDatumReader(org.apache.avro.Schema schema)`
`org.apache.avro.io.DatumWriter` `createDatumWriter(org.apache.avro.Schema schema)`
`static ThriftData` `get()` Return the singleton instance.
`protected org.apache.avro.Schema` `getEnumSchema(Object datum)`
`Object` `getField(Object r, String name, int pos)`
`protected Object` `getField(Object record, String name, int pos, Object state)`
`protected org.apache.avro.Schema` `getRecordSchema(Object record)`
`protected Object` `getRecordState(Object r, org.apache.avro.Schema s)`
`org.apache.avro.Schema` `getSchema(Class c)` Return a record schema given a thrift generated class.
`protected String` `getSchemaName(Object datum)`
`protected boolean` `isBytes(Object datum)`
`protected boolean` `isEnum(Object datum)`
`protected boolean` `isRecord(Object datum)`
`Object` `newRecord(Object old, org.apache.avro.Schema schema)`
`void` `setField(Object r, String n, int pos, Object value)`
`protected void` `setField(Object record, String name, int position, Object value, Object state)`

### Methods inherited from class org.apache.avro.generic.GenericData

`addLogicalTypeConversion, compare, compare, compareMaps, createDatumReader, createEnum, createFixed, createFixed, createString, deepCopy, getArrayAsCollection, getClassLoader, getConversionByClass, getConversionByClass, getConversionFor, getConversions, getDefaultValue, getFastReaderBuilder, getFixedSchema, getNewRecordSupplier, getPrimitiveTypeCache, hashCode, hashCodeAdd, induce, instanceOf, isArray, isBoolean, isDouble, isFastReaderEnabled, isFixed, isFloat, isInteger, isLong, isMap, isString, newArray, newMap, resolveUnion, setFastReaderEnabled, setStringType, toString, toString, validate`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### ThriftData

    protected ThriftData()

### Method Detail

#### get

    public static ThriftData get()

Return the singleton instance.

#### createDatumReader

    public org.apache.avro.io.DatumReader createDatumReader(org.apache.avro.Schema schema)

Overrides:
  `createDatumReader` in class `org.apache.avro.generic.GenericData`

#### createDatumWriter

    public org.apache.avro.io.DatumWriter createDatumWriter(org.apache.avro.Schema schema)

Overrides:
  `createDatumWriter` in class `org.apache.avro.generic.GenericData`

#### setField

    public void setField(Object r,
                         String n,
                         int pos,
                         Object value)

Overrides:
  `setField` in class `org.apache.avro.generic.GenericData`

#### getField

    public Object getField(Object r,
                           String name,
                           int pos)

Overrides:
  `getField` in class `org.apache.avro.generic.GenericData`

#### setField

    protected void setField(Object record,
                            String name,
                            int position,
                            Object value,
                            Object state)

Overrides:
  `setField` in class `org.apache.avro.generic.GenericData`

#### getField

    protected Object getField(Object record,
                              String name,
                              int pos,
                              Object state)

Overrides:
  `getField` in class `org.apache.avro.generic.GenericData`

#### getRecordState

    protected Object getRecordState(Object r,
                                    org.apache.avro.Schema s)

Overrides:
  `getRecordState` in class `org.apache.avro.generic.GenericData`

#### getSchemaName

    protected String getSchemaName(Object datum)

Overrides:
  `getSchemaName` in class `org.apache.avro.generic.GenericData`

#### isRecord

    protected boolean isRecord(Object datum)

Overrides:
  `isRecord` in class `org.apache.avro.generic.GenericData`

#### isEnum

    protected boolean isEnum(Object datum)

Overrides:
  `isEnum` in class `org.apache.avro.generic.GenericData`

#### getEnumSchema

    protected org.apache.avro.Schema getEnumSchema(Object datum)

Overrides:
  `getEnumSchema` in class `org.apache.avro.generic.GenericData`

#### isBytes

    protected boolean isBytes(Object datum)

Overrides:
  `isBytes` in class `org.apache.avro.generic.GenericData`

#### newRecord

    public Object newRecord(Object old,
                            org.apache.avro.Schema schema)

Overrides:
  `newRecord` in class `org.apache.avro.generic.GenericData`

#### getRecordSchema

    protected org.apache.avro.Schema getRecordSchema(Object record)

Overrides:
  `getRecordSchema` in class `org.apache.avro.generic.GenericData`

#### getSchema

    public org.apache.avro.Schema getSchema(Class c)

Return a record schema given a thrift generated class.