com.fasterxml.jackson.dataformat.avro.ser

## Class NonBSGenericDatumWriter<D>

- java.lang.Object
- - org.apache.avro.generic.GenericDatumWriter<D>
  - - com.fasterxml.jackson.dataformat.avro.ser.NonBSGenericDatumWriter<D>

- All Implemented Interfaces:
    org.apache.avro.io.DatumWriter<D>

      public class NonBSGenericDatumWriter<D>
      extends org.apache.avro.generic.GenericDatumWriter<D>

  Need to sub-class to prevent encoder from crapping on writing an optional Enum value (see [dataformat-avro#12])
  Since:
    2.5

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `NonBSGenericDatumWriter(org.apache.avro.Schema root)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `int` | `resolveUnion(org.apache.avro.Schema union, Object datum)`
    `protected void` | `write(org.apache.avro.Schema schema, Object datum, org.apache.avro.io.Encoder out)`

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

      `convert, getArrayElements, getArraySize, getData, getMapEntries, getMapSize, npe, setSchema, write, writeArray, writeBytes, writeEnum, writeField, writeFixed, writeMap, writeRecord, writeString, writeString, writeWithoutConversion`

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

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

- - ### Constructor Detail

    - #### NonBSGenericDatumWriter

          public NonBSGenericDatumWriter(org.apache.avro.Schema root)

  - ### Method Detail

    - #### resolveUnion

          public int resolveUnion(org.apache.avro.Schema union,
                         Object datum)

      Overrides:
        `resolveUnion` in class `org.apache.avro.generic.GenericDatumWriter<D>`

    - #### write

          protected void write(org.apache.avro.Schema schema,
                   Object datum,
                   org.apache.avro.io.Encoder out)
                        throws IOException

      Overrides:
        `write` in class `org.apache.avro.generic.GenericDatumWriter<D>`
      Throws:
        `IOException`

Copyright © 2017 FasterXML. All rights reserved.