org.apache.avro.thrift

## Class ThriftDatumReader<T>

- java.lang.Object
- - org.apache.avro.generic.GenericDatumReader<T>
  - - org.apache.avro.thrift.ThriftDatumReader<T>

- All Implemented Interfaces:
    DatumReader<T>

      public class ThriftDatumReader<T>
      extends GenericDatumReader<T>

  `DatumReader` for generated Thrift classes.

- - ### Constructor Summary

    Constructors
    Modifier | Constructor and Description
    --- | ---
    `` | `ThriftDatumReader()`
    `` | `ThriftDatumReader(Class<T> c)`
    `` | `ThriftDatumReader(Schema schema)` Construct where the writer's and reader's schemas are the same.
    `` | `ThriftDatumReader(Schema writer, Schema reader)` Construct given writer's and reader's schema.
    `protected` | `ThriftDatumReader(Schema writer, Schema reader, ThriftData data)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected Object` | `createEnum(String symbol, Schema schema)` Called to create an enum value.
    `protected Object` | `newArray(Object old, int size, Schema schema)` Called to create new array instances.
    `protected Object` | `readInt(Object old, Schema s, Decoder in)` Called to read integers.

    - ### Methods inherited from class org.apache.avro.generic.GenericDatumReader

      `addToArray, addToMap, convert, createBytes, createFixed, createFixed, createString, findStringClass, getData, getExpected, getResolver, getSchema, newInstanceFromString, newMap, newRecord, peekArray, read, read, readArray, readBytes, readBytes, readEnum, readField, readFixed, readMap, readMapKey, readRecord, readString, readString, readWithConversion, readWithoutConversion, setExpected, setSchema, skip`

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

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

- - ### Constructor Detail

    - #### ThriftDatumReader

          public ThriftDatumReader()

    - #### ThriftDatumReader

          public ThriftDatumReader(Class<T> c)

    - #### ThriftDatumReader

          public ThriftDatumReader(Schema schema)

      Construct where the writer's and reader's schemas are the same.

    - #### ThriftDatumReader

          public ThriftDatumReader(Schema writer,
                                   Schema reader)

      Construct given writer's and reader's schema.

    - #### ThriftDatumReader

          protected ThriftDatumReader(Schema writer,
                                      Schema reader,
                                      ThriftData data)

  - ### Method Detail

    - #### createEnum

          protected Object createEnum(String symbol,
                                      Schema schema)

      Description copied from class: `GenericDatumReader`
      Called to create an enum value. May be overridden for alternate enum representations. By default, returns a GenericEnumSymbol.
      Overrides:
        `createEnum` in class `GenericDatumReader<T>`

    - #### readInt

          protected Object readInt(Object old,
                                   Schema s,
                                   Decoder in)
                            throws IOException

      Description copied from class: `GenericDatumReader`
      Called to read integers. Subclasses may override to use a different integer representation. By default, this calls `Decoder.readInt()`.
      Overrides:
        `readInt` in class `GenericDatumReader<T>`
      Throws:
        `IOException`

    - #### newArray

          protected Object newArray(Object old,
                                    int size,
                                    Schema schema)

      Description copied from class: `GenericDatumReader`
      Called to create new array instances. Subclasses may override to use a different array implementation. By default, this returns a `GenericData.Array`.
      Overrides:
        `newArray` in class `GenericDatumReader<T>`

Copyright © 2009–2024 The Apache Software Foundation. All rights reserved.