/**
 * Autogenerated by Avro
 *
 * DO NOT EDIT DIRECTLY
 */
package com.huawei.hwclouds.drs.avro;

import org.apache.avro.generic.GenericArray;
import org.apache.avro.specific.SpecificData;
import org.apache.avro.util.Utf8;
import org.apache.avro.message.BinaryMessageEncoder;
import org.apache.avro.message.BinaryMessageDecoder;
import org.apache.avro.message.SchemaStore;

@org.apache.avro.specific.AvroGenerated
public class Record extends org.apache.avro.specific.SpecificRecordBase implements org.apache.avro.specific.SpecificRecord {
  private static final long serialVersionUID = 6043883312813960279L;
  public static final org.apache.avro.Schema SCHEMA$ = new org.apache.avro.Schema.Parser().parse("{\"type\":\"record\",\"name\":\"Record\",\"namespace\":\"com.huawei.hwclouds.drs.avro\",\"fields\":[{\"name\":\"version\",\"type\":\"string\",\"doc\":\"version infomation\"},{\"name\":\"seqno\",\"type\":\"long\",\"doc\":\"seqno\"},{\"name\":\"shardId\",\"type\":\"long\",\"doc\":\"shardId\"},{\"name\":\"eventid\",\"type\":\"string\",\"doc\":\"eventid\"},{\"name\":\"updateTimestamp\",\"type\":\"long\",\"doc\":\"updateTimestamp\"},{\"name\":\"tableName\",\"type\":[\"null\",\"string\"],\"default\":null},{\"name\":\"operation\",\"type\":\"string\",\"doc\":\"INSERT,DELETE,UPDATE,DDL\"},{\"name\":\"columnCount\",\"type\":\"long\",\"doc\":\"field column count\"},{\"name\":\"fields\",\"type\":[\"null\",{\"type\":\"array\",\"items\":{\"type\":\"record\",\"name\":\"Field\",\"fields\":[{\"name\":\"name\",\"type\":\"string\"},{\"name\":\"dataTypeNumber\",\"type\":\"int\",\"doc\":\"2004, BinaryObject\"}]}}],\"default\":null},{\"name\":\"beforeImages\",\"type\":[\"null\",{\"type\":\"array\",\"items\":[\"null\",{\"type\":\"record\",\"name\":\"Integer\",\"fields\":[{\"name\":\"precision\",\"type\":\"int\"},{\"name\":\"value\",\"type\":\"string\"}]},{\"type\":\"record\",\"name\":\"Character\",\"fields\":[{\"name\":\"charset\",\"type\":\"string\"},{\"name\":\"value\",\"type\":\"bytes\"}]},{\"type\":\"record\",\"name\":\"Decimal\",\"fields\":[{\"name\":\"value\",\"type\":\"string\"},{\"name\":\"precision\",\"type\":\"int\"},{\"name\":\"scale\",\"type\":\"int\"}]},{\"type\":\"record\",\"name\":\"Float\",\"fields\":[{\"name\":\"value\",\"type\":\"double\"},{\"name\":\"precision\",\"type\":\"int\"},{\"name\":\"scale\",\"type\":\"int\"}]},{\"type\":\"record\",\"name\":\"Timestamp\",\"fields\":[{\"name\":\"timestamp\",\"type\":\"long\"},{\"name\":\"millis\",\"type\":\"int\"}]},{\"type\":\"record\",\"name\":\"Date\",\"fields\":[{\"name\":\"value\",\"type\":\"string\",\"doc\":\"Field.dataTypeNumber = 94(DateTime) format:YYYY-MM-DD HH24:MI:SS.ff\"}]},{\"type\":\"record\",\"name\":\"Bit\",\"fields\":[{\"name\":\"precision\",\"type\":\"int\"},{\"name\":\"value\",\"type\":\"string\"}]},{\"type\":\"record\",\"name\":\"BinaryObject\",\"fields\":[{\"name\":\"type\",\"type\":\"string\"},{\"name\":\"value\",\"type\":\"bytes\"}]},{\"type\":\"record\",\"name\":\"TimestampWithTimezone\",\"fields\":[{\"name\":\"value\",\"type\":\"string\",\"doc\":\"format:YYYY-MM-DD HH24:MI:SS.ff\"},{\"name\":\"timezone\",\"type\":\"string\"}]}]}],\"default\":null},{\"name\":\"afterImages\",\"type\":[\"null\",{\"type\":\"array\",\"items\":[\"null\",\"Integer\",\"Character\",\"Decimal\",\"Float\",\"Timestamp\",\"Date\",\"Bit\",\"BinaryObject\",\"TimestampWithTimezone\"]}],\"default\":null},{\"name\":\"signature\",\"type\":[\"null\",\"string\"],\"doc\":\"signature\",\"default\":null},{\"name\":\"transactionId\",\"type\":[\"null\",\"long\"],\"doc\":\"Transaction Id\",\"default\":null},{\"name\":\"rowid\",\"type\":[\"null\",\"string\"],\"doc\":\"rowid\",\"default\":null},{\"name\":\"sourceDb\",\"type\":[\"null\",\"string\"],\"doc\":\"mysql,oracle\",\"default\":null}]}");
  public static org.apache.avro.Schema getClassSchema() { return SCHEMA$; }

  private static SpecificData MODEL$ = new SpecificData();

  private static final BinaryMessageEncoder<Record> ENCODER =
      new BinaryMessageEncoder<Record>(MODEL$, SCHEMA$);

  private static final BinaryMessageDecoder<Record> DECODER =
      new BinaryMessageDecoder<Record>(MODEL$, SCHEMA$);

  /**
   * Return the BinaryMessageEncoder instance used by this class.
   * @return the message encoder used by this class
   */
  public static BinaryMessageEncoder<Record> getEncoder() {
    return ENCODER;
  }

  /**
   * Return the BinaryMessageDecoder instance used by this class.
   * @return the message decoder used by this class
   */
  public static BinaryMessageDecoder<Record> getDecoder() {
    return DECODER;
  }

  /**
   * Create a new BinaryMessageDecoder instance for this class that uses the specified {@link SchemaStore}.
   * @param resolver a {@link SchemaStore} used to find schemas by fingerprint
   * @return a BinaryMessageDecoder instance for this class backed by the given SchemaStore
   */
  public static BinaryMessageDecoder<Record> createDecoder(SchemaStore resolver) {
    return new BinaryMessageDecoder<Record>(MODEL$, SCHEMA$, resolver);
  }

  /**
   * Serializes this Record to a ByteBuffer.
   * @return a buffer holding the serialized data for this instance
   * @throws java.io.IOException if this instance could not be serialized
   */
  public java.nio.ByteBuffer toByteBuffer() throws java.io.IOException {
    return ENCODER.encode(this);
  }

  /**
   * Deserializes a Record from a ByteBuffer.
   * @param b a byte buffer holding serialized data for an instance of this class
   * @return a Record instance decoded from the given buffer
   * @throws java.io.IOException if the given bytes could not be deserialized into an instance of this class
   */
  public static Record fromByteBuffer(
      java.nio.ByteBuffer b) throws java.io.IOException {
    return DECODER.decode(b);
  }

  /** version infomation */
   private java.lang.CharSequence version;
  /** seqno */
   private long seqno;
  /** shardId */
   private long shardId;
  /** eventid */
   private java.lang.CharSequence eventid;
  /** updateTimestamp */
   private long updateTimestamp;
   private java.lang.CharSequence tableName;
  /** INSERT,DELETE,UPDATE,DDL */
   private java.lang.CharSequence operation;
  /** field column count */
   private long columnCount;
   private java.util.List<com.huawei.hwclouds.drs.avro.Field> fields;
   private java.util.List<java.lang.Object> beforeImages;
   private java.util.List<java.lang.Object> afterImages;
  /** signature */
   private java.lang.CharSequence signature;
  /** Transaction Id */
   private java.lang.Long transactionId;
  /** rowid */
   private java.lang.CharSequence rowid;
  /** mysql,oracle */
   private java.lang.CharSequence sourceDb;

  /**
   * Default constructor.  Note that this does not initialize fields
   * to their default values from the schema.  If that is desired then
   * one should use <code>newBuilder()</code>.
   */
  public Record() {}

  /**
   * All-args constructor.
   * @param version version infomation
   * @param seqno seqno
   * @param shardId shardId
   * @param eventid eventid
   * @param updateTimestamp updateTimestamp
   * @param tableName The new value for tableName
   * @param operation INSERT,DELETE,UPDATE,DDL
   * @param columnCount field column count
   * @param fields The new value for fields
   * @param beforeImages The new value for beforeImages
   * @param afterImages The new value for afterImages
   * @param signature signature
   * @param transactionId Transaction Id
   * @param rowid rowid
   * @param sourceDb mysql,oracle
   */
  public Record(java.lang.CharSequence version, java.lang.Long seqno, java.lang.Long shardId, java.lang.CharSequence eventid, java.lang.Long updateTimestamp, java.lang.CharSequence tableName, java.lang.CharSequence operation, java.lang.Long columnCount, java.util.List<com.huawei.hwclouds.drs.avro.Field> fields, java.util.List<java.lang.Object> beforeImages, java.util.List<java.lang.Object> afterImages, java.lang.CharSequence signature, java.lang.Long transactionId, java.lang.CharSequence rowid, java.lang.CharSequence sourceDb) {
    this.version = version;
    this.seqno = seqno;
    this.shardId = shardId;
    this.eventid = eventid;
    this.updateTimestamp = updateTimestamp;
    this.tableName = tableName;
    this.operation = operation;
    this.columnCount = columnCount;
    this.fields = fields;
    this.beforeImages = beforeImages;
    this.afterImages = afterImages;
    this.signature = signature;
    this.transactionId = transactionId;
    this.rowid = rowid;
    this.sourceDb = sourceDb;
  }

  public org.apache.avro.specific.SpecificData getSpecificData() { return MODEL$; }
  public org.apache.avro.Schema getSchema() { return SCHEMA$; }
  // Used by DatumWriter.  Applications should not call.
  public java.lang.Object get(int field$) {
    switch (field$) {
    case 0: return version;
    case 1: return seqno;
    case 2: return shardId;
    case 3: return eventid;
    case 4: return updateTimestamp;
    case 5: return tableName;
    case 6: return operation;
    case 7: return columnCount;
    case 8: return fields;
    case 9: return beforeImages;
    case 10: return afterImages;
    case 11: return signature;
    case 12: return transactionId;
    case 13: return rowid;
    case 14: return sourceDb;
    default: throw new org.apache.avro.AvroRuntimeException("Bad index");
    }
  }

  // Used by DatumReader.  Applications should not call.
  @SuppressWarnings(value="unchecked")
  public void put(int field$, java.lang.Object value$) {
    switch (field$) {
    case 0: version = (java.lang.CharSequence)value$; break;
    case 1: seqno = (java.lang.Long)value$; break;
    case 2: shardId = (java.lang.Long)value$; break;
    case 3: eventid = (java.lang.CharSequence)value$; break;
    case 4: updateTimestamp = (java.lang.Long)value$; break;
    case 5: tableName = (java.lang.CharSequence)value$; break;
    case 6: operation = (java.lang.CharSequence)value$; break;
    case 7: columnCount = (java.lang.Long)value$; break;
    case 8: fields = (java.util.List<com.huawei.hwclouds.drs.avro.Field>)value$; break;
    case 9: beforeImages = (java.util.List<java.lang.Object>)value$; break;
    case 10: afterImages = (java.util.List<java.lang.Object>)value$; break;
    case 11: signature = (java.lang.CharSequence)value$; break;
    case 12: transactionId = (java.lang.Long)value$; break;
    case 13: rowid = (java.lang.CharSequence)value$; break;
    case 14: sourceDb = (java.lang.CharSequence)value$; break;
    default: throw new org.apache.avro.AvroRuntimeException("Bad index");
    }
  }

  /**
   * Gets the value of the 'version' field.
   * @return version infomation
   */
  public java.lang.CharSequence getVersion() {
    return version;
  }


  /**
   * Sets the value of the 'version' field.
   * version infomation
   * @param value the value to set.
   */
  public void setVersion(java.lang.CharSequence value) {
    this.version = value;
  }

  /**
   * Gets the value of the 'seqno' field.
   * @return seqno
   */
  public long getSeqno() {
    return seqno;
  }


  /**
   * Sets the value of the 'seqno' field.
   * seqno
   * @param value the value to set.
   */
  public void setSeqno(long value) {
    this.seqno = value;
  }

  /**
   * Gets the value of the 'shardId' field.
   * @return shardId
   */
  public long getShardId() {
    return shardId;
  }


  /**
   * Sets the value of the 'shardId' field.
   * shardId
   * @param value the value to set.
   */
  public void setShardId(long value) {
    this.shardId = value;
  }

  /**
   * Gets the value of the 'eventid' field.
   * @return eventid
   */
  public java.lang.CharSequence getEventid() {
    return eventid;
  }


  /**
   * Sets the value of the 'eventid' field.
   * eventid
   * @param value the value to set.
   */
  public void setEventid(java.lang.CharSequence value) {
    this.eventid = value;
  }

  /**
   * Gets the value of the 'updateTimestamp' field.
   * @return updateTimestamp
   */
  public long getUpdateTimestamp() {
    return updateTimestamp;
  }


  /**
   * Sets the value of the 'updateTimestamp' field.
   * updateTimestamp
   * @param value the value to set.
   */
  public void setUpdateTimestamp(long value) {
    this.updateTimestamp = value;
  }

  /**
   * Gets the value of the 'tableName' field.
   * @return The value of the 'tableName' field.
   */
  public java.lang.CharSequence getTableName() {
    return tableName;
  }


  /**
   * Sets the value of the 'tableName' field.
   * @param value the value to set.
   */
  public void setTableName(java.lang.CharSequence value) {
    this.tableName = value;
  }

  /**
   * Gets the value of the 'operation' field.
   * @return INSERT,DELETE,UPDATE,DDL
   */
  public java.lang.CharSequence getOperation() {
    return operation;
  }


  /**
   * Sets the value of the 'operation' field.
   * INSERT,DELETE,UPDATE,DDL
   * @param value the value to set.
   */
  public void setOperation(java.lang.CharSequence value) {
    this.operation = value;
  }

  /**
   * Gets the value of the 'columnCount' field.
   * @return field column count
   */
  public long getColumnCount() {
    return columnCount;
  }


  /**
   * Sets the value of the 'columnCount' field.
   * field column count
   * @param value the value to set.
   */
  public void setColumnCount(long value) {
    this.columnCount = value;
  }

  /**
   * Gets the value of the 'fields' field.
   * @return The value of the 'fields' field.
   */
  public java.util.List<com.huawei.hwclouds.drs.avro.Field> getFields() {
    return fields;
  }


  /**
   * Sets the value of the 'fields' field.
   * @param value the value to set.
   */
  public void setFields(java.util.List<com.huawei.hwclouds.drs.avro.Field> value) {
    this.fields = value;
  }

  /**
   * Gets the value of the 'beforeImages' field.
   * @return The value of the 'beforeImages' field.
   */
  public java.util.List<java.lang.Object> getBeforeImages() {
    return beforeImages;
  }


  /**
   * Sets the value of the 'beforeImages' field.
   * @param value the value to set.
   */
  public void setBeforeImages(java.util.List<java.lang.Object> value) {
    this.beforeImages = value;
  }

  /**
   * Gets the value of the 'afterImages' field.
   * @return The value of the 'afterImages' field.
   */
  public java.util.List<java.lang.Object> getAfterImages() {
    return afterImages;
  }


  /**
   * Sets the value of the 'afterImages' field.
   * @param value the value to set.
   */
  public void setAfterImages(java.util.List<java.lang.Object> value) {
    this.afterImages = value;
  }

  /**
   * Gets the value of the 'signature' field.
   * @return signature
   */
  public java.lang.CharSequence getSignature() {
    return signature;
  }


  /**
   * Sets the value of the 'signature' field.
   * signature
   * @param value the value to set.
   */
  public void setSignature(java.lang.CharSequence value) {
    this.signature = value;
  }

  /**
   * Gets the value of the 'transactionId' field.
   * @return Transaction Id
   */
  public java.lang.Long getTransactionId() {
    return transactionId;
  }


  /**
   * Sets the value of the 'transactionId' field.
   * Transaction Id
   * @param value the value to set.
   */
  public void setTransactionId(java.lang.Long value) {
    this.transactionId = value;
  }

  /**
   * Gets the value of the 'rowid' field.
   * @return rowid
   */
  public java.lang.CharSequence getRowid() {
    return rowid;
  }


  /**
   * Sets the value of the 'rowid' field.
   * rowid
   * @param value the value to set.
   */
  public void setRowid(java.lang.CharSequence value) {
    this.rowid = value;
  }

  /**
   * Gets the value of the 'sourceDb' field.
   * @return mysql,oracle
   */
  public java.lang.CharSequence getSourceDb() {
    return sourceDb;
  }


  /**
   * Sets the value of the 'sourceDb' field.
   * mysql,oracle
   * @param value the value to set.
   */
  public void setSourceDb(java.lang.CharSequence value) {
    this.sourceDb = value;
  }

  /**
   * Creates a new Record RecordBuilder.
   * @return A new Record RecordBuilder
   */
  public static com.huawei.hwclouds.drs.avro.Record.Builder newBuilder() {
    return new com.huawei.hwclouds.drs.avro.Record.Builder();
  }

  /**
   * Creates a new Record RecordBuilder by copying an existing Builder.
   * @param other The existing builder to copy.
   * @return A new Record RecordBuilder
   */
  public static com.huawei.hwclouds.drs.avro.Record.Builder newBuilder(com.huawei.hwclouds.drs.avro.Record.Builder other) {
    if (other == null) {
      return new com.huawei.hwclouds.drs.avro.Record.Builder();
    } else {
      return new com.huawei.hwclouds.drs.avro.Record.Builder(other);
    }
  }

  /**
   * Creates a new Record RecordBuilder by copying an existing Record instance.
   * @param other The existing instance to copy.
   * @return A new Record RecordBuilder
   */
  public static com.huawei.hwclouds.drs.avro.Record.Builder newBuilder(com.huawei.hwclouds.drs.avro.Record other) {
    if (other == null) {
      return new com.huawei.hwclouds.drs.avro.Record.Builder();
    } else {
      return new com.huawei.hwclouds.drs.avro.Record.Builder(other);
    }
  }

  /**
   * RecordBuilder for Record instances.
   */
  public static class Builder extends org.apache.avro.specific.SpecificRecordBuilderBase<Record>
    implements org.apache.avro.data.RecordBuilder<Record> {

    /** version infomation */
    private java.lang.CharSequence version;
    /** seqno */
    private long seqno;
    /** shardId */
    private long shardId;
    /** eventid */
    private java.lang.CharSequence eventid;
    /** updateTimestamp */
    private long updateTimestamp;
    private java.lang.CharSequence tableName;
    /** INSERT,DELETE,UPDATE,DDL */
    private java.lang.CharSequence operation;
    /** field column count */
    private long columnCount;
    private java.util.List<com.huawei.hwclouds.drs.avro.Field> fields;
    private java.util.List<java.lang.Object> beforeImages;
    private java.util.List<java.lang.Object> afterImages;
    /** signature */
    private java.lang.CharSequence signature;
    /** Transaction Id */
    private java.lang.Long transactionId;
    /** rowid */
    private java.lang.CharSequence rowid;
    /** mysql,oracle */
    private java.lang.CharSequence sourceDb;

    /** Creates a new Builder */
    private Builder() {
      super(SCHEMA$);
    }

    /**
     * Creates a Builder by copying an existing Builder.
     * @param other The existing Builder to copy.
     */
    private Builder(com.huawei.hwclouds.drs.avro.Record.Builder other) {
      super(other);
      if (isValidValue(fields()[0], other.version)) {
        this.version = data().deepCopy(fields()[0].schema(), other.version);
        fieldSetFlags()[0] = other.fieldSetFlags()[0];
      }
      if (isValidValue(fields()[1], other.seqno)) {
        this.seqno = data().deepCopy(fields()[1].schema(), other.seqno);
        fieldSetFlags()[1] = other.fieldSetFlags()[1];
      }
      if (isValidValue(fields()[2], other.shardId)) {
        this.shardId = data().deepCopy(fields()[2].schema(), other.shardId);
        fieldSetFlags()[2] = other.fieldSetFlags()[2];
      }
      if (isValidValue(fields()[3], other.eventid)) {
        this.eventid = data().deepCopy(fields()[3].schema(), other.eventid);
        fieldSetFlags()[3] = other.fieldSetFlags()[3];
      }
      if (isValidValue(fields()[4], other.updateTimestamp)) {
        this.updateTimestamp = data().deepCopy(fields()[4].schema(), other.updateTimestamp);
        fieldSetFlags()[4] = other.fieldSetFlags()[4];
      }
      if (isValidValue(fields()[5], other.tableName)) {
        this.tableName = data().deepCopy(fields()[5].schema(), other.tableName);
        fieldSetFlags()[5] = other.fieldSetFlags()[5];
      }
      if (isValidValue(fields()[6], other.operation)) {
        this.operation = data().deepCopy(fields()[6].schema(), other.operation);
        fieldSetFlags()[6] = other.fieldSetFlags()[6];
      }
      if (isValidValue(fields()[7], other.columnCount)) {
        this.columnCount = data().deepCopy(fields()[7].schema(), other.columnCount);
        fieldSetFlags()[7] = other.fieldSetFlags()[7];
      }
      if (isValidValue(fields()[8], other.fields)) {
        this.fields = data().deepCopy(fields()[8].schema(), other.fields);
        fieldSetFlags()[8] = other.fieldSetFlags()[8];
      }
      if (isValidValue(fields()[9], other.beforeImages)) {
        this.beforeImages = data().deepCopy(fields()[9].schema(), other.beforeImages);
        fieldSetFlags()[9] = other.fieldSetFlags()[9];
      }
      if (isValidValue(fields()[10], other.afterImages)) {
        this.afterImages = data().deepCopy(fields()[10].schema(), other.afterImages);
        fieldSetFlags()[10] = other.fieldSetFlags()[10];
      }
      if (isValidValue(fields()[11], other.signature)) {
        this.signature = data().deepCopy(fields()[11].schema(), other.signature);
        fieldSetFlags()[11] = other.fieldSetFlags()[11];
      }
      if (isValidValue(fields()[12], other.transactionId)) {
        this.transactionId = data().deepCopy(fields()[12].schema(), other.transactionId);
        fieldSetFlags()[12] = other.fieldSetFlags()[12];
      }
      if (isValidValue(fields()[13], other.rowid)) {
        this.rowid = data().deepCopy(fields()[13].schema(), other.rowid);
        fieldSetFlags()[13] = other.fieldSetFlags()[13];
      }
      if (isValidValue(fields()[14], other.sourceDb)) {
        this.sourceDb = data().deepCopy(fields()[14].schema(), other.sourceDb);
        fieldSetFlags()[14] = other.fieldSetFlags()[14];
      }
    }

    /**
     * Creates a Builder by copying an existing Record instance
     * @param other The existing instance to copy.
     */
    private Builder(com.huawei.hwclouds.drs.avro.Record other) {
      super(SCHEMA$);
      if (isValidValue(fields()[0], other.version)) {
        this.version = data().deepCopy(fields()[0].schema(), other.version);
        fieldSetFlags()[0] = true;
      }
      if (isValidValue(fields()[1], other.seqno)) {
        this.seqno = data().deepCopy(fields()[1].schema(), other.seqno);
        fieldSetFlags()[1] = true;
      }
      if (isValidValue(fields()[2], other.shardId)) {
        this.shardId = data().deepCopy(fields()[2].schema(), other.shardId);
        fieldSetFlags()[2] = true;
      }
      if (isValidValue(fields()[3], other.eventid)) {
        this.eventid = data().deepCopy(fields()[3].schema(), other.eventid);
        fieldSetFlags()[3] = true;
      }
      if (isValidValue(fields()[4], other.updateTimestamp)) {
        this.updateTimestamp = data().deepCopy(fields()[4].schema(), other.updateTimestamp);
        fieldSetFlags()[4] = true;
      }
      if (isValidValue(fields()[5], other.tableName)) {
        this.tableName = data().deepCopy(fields()[5].schema(), other.tableName);
        fieldSetFlags()[5] = true;
      }
      if (isValidValue(fields()[6], other.operation)) {
        this.operation = data().deepCopy(fields()[6].schema(), other.operation);
        fieldSetFlags()[6] = true;
      }
      if (isValidValue(fields()[7], other.columnCount)) {
        this.columnCount = data().deepCopy(fields()[7].schema(), other.columnCount);
        fieldSetFlags()[7] = true;
      }
      if (isValidValue(fields()[8], other.fields)) {
        this.fields = data().deepCopy(fields()[8].schema(), other.fields);
        fieldSetFlags()[8] = true;
      }
      if (isValidValue(fields()[9], other.beforeImages)) {
        this.beforeImages = data().deepCopy(fields()[9].schema(), other.beforeImages);
        fieldSetFlags()[9] = true;
      }
      if (isValidValue(fields()[10], other.afterImages)) {
        this.afterImages = data().deepCopy(fields()[10].schema(), other.afterImages);
        fieldSetFlags()[10] = true;
      }
      if (isValidValue(fields()[11], other.signature)) {
        this.signature = data().deepCopy(fields()[11].schema(), other.signature);
        fieldSetFlags()[11] = true;
      }
      if (isValidValue(fields()[12], other.transactionId)) {
        this.transactionId = data().deepCopy(fields()[12].schema(), other.transactionId);
        fieldSetFlags()[12] = true;
      }
      if (isValidValue(fields()[13], other.rowid)) {
        this.rowid = data().deepCopy(fields()[13].schema(), other.rowid);
        fieldSetFlags()[13] = true;
      }
      if (isValidValue(fields()[14], other.sourceDb)) {
        this.sourceDb = data().deepCopy(fields()[14].schema(), other.sourceDb);
        fieldSetFlags()[14] = true;
      }
    }

    /**
      * Gets the value of the 'version' field.
      * version infomation
      * @return The value.
      */
    public java.lang.CharSequence getVersion() {
      return version;
    }


    /**
      * Sets the value of the 'version' field.
      * version infomation
      * @param value The value of 'version'.
      * @return This builder.
      */
    public com.huawei.hwclouds.drs.avro.Record.Builder setVersion(java.lang.CharSequence value) {
      validate(fields()[0], value);
      this.version = value;
      fieldSetFlags()[0] = true;
      return this;
    }

    /**
      * Checks whether the 'version' field has been set.
      * version infomation
      * @return True if the 'version' field has been set, false otherwise.
      */
    public boolean hasVersion() {
      return fieldSetFlags()[0];
    }


    /**
      * Clears the value of the 'version' field.
      * version infomation
      * @return This builder.
      */
    public com.huawei.hwclouds.drs.avro.Record.Builder clearVersion() {
      version = null;
      fieldSetFlags()[0] = false;
      return this;
    }

    /**
      * Gets the value of the 'seqno' field.
      * seqno
      * @return The value.
      */
    public long getSeqno() {
      return seqno;
    }


    /**
      * Sets the value of the 'seqno' field.
      * seqno
      * @param value The value of 'seqno'.
      * @return This builder.
      */
    public com.huawei.hwclouds.drs.avro.Record.Builder setSeqno(long value) {
      validate(fields()[1], value);
      this.seqno = value;
      fieldSetFlags()[1] = true;
      return this;
    }

    /**
      * Checks whether the 'seqno' field has been set.
      * seqno
      * @return True if the 'seqno' field has been set, false otherwise.
      */
    public boolean hasSeqno() {
      return fieldSetFlags()[1];
    }


    /**
      * Clears the value of the 'seqno' field.
      * seqno
      * @return This builder.
      */
    public com.huawei.hwclouds.drs.avro.Record.Builder clearSeqno() {
      fieldSetFlags()[1] = false;
      return this;
    }

    /**
      * Gets the value of the 'shardId' field.
      * shardId
      * @return The value.
      */
    public long getShardId() {
      return shardId;
    }


    /**
      * Sets the value of the 'shardId' field.
      * shardId
      * @param value The value of 'shardId'.
      * @return This builder.
      */
    public com.huawei.hwclouds.drs.avro.Record.Builder setShardId(long value) {
      validate(fields()[2], value);
      this.shardId = value;
      fieldSetFlags()[2] = true;
      return this;
    }

    /**
      * Checks whether the 'shardId' field has been set.
      * shardId
      * @return True if the 'shardId' field has been set, false otherwise.
      */
    public boolean hasShardId() {
      return fieldSetFlags()[2];
    }


    /**
      * Clears the value of the 'shardId' field.
      * shardId
      * @return This builder.
      */
    public com.huawei.hwclouds.drs.avro.Record.Builder clearShardId() {
      fieldSetFlags()[2] = false;
      return this;
    }

    /**
      * Gets the value of the 'eventid' field.
      * eventid
      * @return The value.
      */
    public java.lang.CharSequence getEventid() {
      return eventid;
    }


    /**
      * Sets the value of the 'eventid' field.
      * eventid
      * @param value The value of 'eventid'.
      * @return This builder.
      */
    public com.huawei.hwclouds.drs.avro.Record.Builder setEventid(java.lang.CharSequence value) {
      validate(fields()[3], value);
      this.eventid = value;
      fieldSetFlags()[3] = true;
      return this;
    }

    /**
      * Checks whether the 'eventid' field has been set.
      * eventid
      * @return True if the 'eventid' field has been set, false otherwise.
      */
    public boolean hasEventid() {
      return fieldSetFlags()[3];
    }


    /**
      * Clears the value of the 'eventid' field.
      * eventid
      * @return This builder.
      */
    public com.huawei.hwclouds.drs.avro.Record.Builder clearEventid() {
      eventid = null;
      fieldSetFlags()[3] = false;
      return this;
    }

    /**
      * Gets the value of the 'updateTimestamp' field.
      * updateTimestamp
      * @return The value.
      */
    public long getUpdateTimestamp() {
      return updateTimestamp;
    }


    /**
      * Sets the value of the 'updateTimestamp' field.
      * updateTimestamp
      * @param value The value of 'updateTimestamp'.
      * @return This builder.
      */
    public com.huawei.hwclouds.drs.avro.Record.Builder setUpdateTimestamp(long value) {
      validate(fields()[4], value);
      this.updateTimestamp = value;
      fieldSetFlags()[4] = true;
      return this;
    }

    /**
      * Checks whether the 'updateTimestamp' field has been set.
      * updateTimestamp
      * @return True if the 'updateTimestamp' field has been set, false otherwise.
      */
    public boolean hasUpdateTimestamp() {
      return fieldSetFlags()[4];
    }


    /**
      * Clears the value of the 'updateTimestamp' field.
      * updateTimestamp
      * @return This builder.
      */
    public com.huawei.hwclouds.drs.avro.Record.Builder clearUpdateTimestamp() {
      fieldSetFlags()[4] = false;
      return this;
    }

    /**
      * Gets the value of the 'tableName' field.
      * @return The value.
      */
    public java.lang.CharSequence getTableName() {
      return tableName;
    }


    /**
      * Sets the value of the 'tableName' field.
      * @param value The value of 'tableName'.
      * @return This builder.
      */
    public com.huawei.hwclouds.drs.avro.Record.Builder setTableName(java.lang.CharSequence value) {
      validate(fields()[5], value);
      this.tableName = value;
      fieldSetFlags()[5] = true;
      return this;
    }

    /**
      * Checks whether the 'tableName' field has been set.
      * @return True if the 'tableName' field has been set, false otherwise.
      */
    public boolean hasTableName() {
      return fieldSetFlags()[5];
    }


    /**
      * Clears the value of the 'tableName' field.
      * @return This builder.
      */
    public com.huawei.hwclouds.drs.avro.Record.Builder clearTableName() {
      tableName = null;
      fieldSetFlags()[5] = false;
      return this;
    }

    /**
      * Gets the value of the 'operation' field.
      * INSERT,DELETE,UPDATE,DDL
      * @return The value.
      */
    public java.lang.CharSequence getOperation() {
      return operation;
    }


    /**
      * Sets the value of the 'operation' field.
      * INSERT,DELETE,UPDATE,DDL
      * @param value The value of 'operation'.
      * @return This builder.
      */
    public com.huawei.hwclouds.drs.avro.Record.Builder setOperation(java.lang.CharSequence value) {
      validate(fields()[6], value);
      this.operation = value;
      fieldSetFlags()[6] = true;
      return this;
    }

    /**
      * Checks whether the 'operation' field has been set.
      * INSERT,DELETE,UPDATE,DDL
      * @return True if the 'operation' field has been set, false otherwise.
      */
    public boolean hasOperation() {
      return fieldSetFlags()[6];
    }


    /**
      * Clears the value of the 'operation' field.
      * INSERT,DELETE,UPDATE,DDL
      * @return This builder.
      */
    public com.huawei.hwclouds.drs.avro.Record.Builder clearOperation() {
      operation = null;
      fieldSetFlags()[6] = false;
      return this;
    }

    /**
      * Gets the value of the 'columnCount' field.
      * field column count
      * @return The value.
      */
    public long getColumnCount() {
      return columnCount;
    }


    /**
      * Sets the value of the 'columnCount' field.
      * field column count
      * @param value The value of 'columnCount'.
      * @return This builder.
      */
    public com.huawei.hwclouds.drs.avro.Record.Builder setColumnCount(long value) {
      validate(fields()[7], value);
      this.columnCount = value;
      fieldSetFlags()[7] = true;
      return this;
    }

    /**
      * Checks whether the 'columnCount' field has been set.
      * field column count
      * @return True if the 'columnCount' field has been set, false otherwise.
      */
    public boolean hasColumnCount() {
      return fieldSetFlags()[7];
    }


    /**
      * Clears the value of the 'columnCount' field.
      * field column count
      * @return This builder.
      */
    public com.huawei.hwclouds.drs.avro.Record.Builder clearColumnCount() {
      fieldSetFlags()[7] = false;
      return this;
    }

    /**
      * Gets the value of the 'fields' field.
      * @return The value.
      */
    public java.util.List<com.huawei.hwclouds.drs.avro.Field> getFields() {
      return fields;
    }


    /**
      * Sets the value of the 'fields' field.
      * @param value The value of 'fields'.
      * @return This builder.
      */
    public com.huawei.hwclouds.drs.avro.Record.Builder setFields(java.util.List<com.huawei.hwclouds.drs.avro.Field> value) {
      validate(fields()[8], value);
      this.fields = value;
      fieldSetFlags()[8] = true;
      return this;
    }

    /**
      * Checks whether the 'fields' field has been set.
      * @return True if the 'fields' field has been set, false otherwise.
      */
    public boolean hasFields() {
      return fieldSetFlags()[8];
    }


    /**
      * Clears the value of the 'fields' field.
      * @return This builder.
      */
    public com.huawei.hwclouds.drs.avro.Record.Builder clearFields() {
      fields = null;
      fieldSetFlags()[8] = false;
      return this;
    }

    /**
      * Gets the value of the 'beforeImages' field.
      * @return The value.
      */
    public java.util.List<java.lang.Object> getBeforeImages() {
      return beforeImages;
    }


    /**
      * Sets the value of the 'beforeImages' field.
      * @param value The value of 'beforeImages'.
      * @return This builder.
      */
    public com.huawei.hwclouds.drs.avro.Record.Builder setBeforeImages(java.util.List<java.lang.Object> value) {
      validate(fields()[9], value);
      this.beforeImages = value;
      fieldSetFlags()[9] = true;
      return this;
    }

    /**
      * Checks whether the 'beforeImages' field has been set.
      * @return True if the 'beforeImages' field has been set, false otherwise.
      */
    public boolean hasBeforeImages() {
      return fieldSetFlags()[9];
    }


    /**
      * Clears the value of the 'beforeImages' field.
      * @return This builder.
      */
    public com.huawei.hwclouds.drs.avro.Record.Builder clearBeforeImages() {
      beforeImages = null;
      fieldSetFlags()[9] = false;
      return this;
    }

    /**
      * Gets the value of the 'afterImages' field.
      * @return The value.
      */
    public java.util.List<java.lang.Object> getAfterImages() {
      return afterImages;
    }


    /**
      * Sets the value of the 'afterImages' field.
      * @param value The value of 'afterImages'.
      * @return This builder.
      */
    public com.huawei.hwclouds.drs.avro.Record.Builder setAfterImages(java.util.List<java.lang.Object> value) {
      validate(fields()[10], value);
      this.afterImages = value;
      fieldSetFlags()[10] = true;
      return this;
    }

    /**
      * Checks whether the 'afterImages' field has been set.
      * @return True if the 'afterImages' field has been set, false otherwise.
      */
    public boolean hasAfterImages() {
      return fieldSetFlags()[10];
    }


    /**
      * Clears the value of the 'afterImages' field.
      * @return This builder.
      */
    public com.huawei.hwclouds.drs.avro.Record.Builder clearAfterImages() {
      afterImages = null;
      fieldSetFlags()[10] = false;
      return this;
    }

    /**
      * Gets the value of the 'signature' field.
      * signature
      * @return The value.
      */
    public java.lang.CharSequence getSignature() {
      return signature;
    }


    /**
      * Sets the value of the 'signature' field.
      * signature
      * @param value The value of 'signature'.
      * @return This builder.
      */
    public com.huawei.hwclouds.drs.avro.Record.Builder setSignature(java.lang.CharSequence value) {
      validate(fields()[11], value);
      this.signature = value;
      fieldSetFlags()[11] = true;
      return this;
    }

    /**
      * Checks whether the 'signature' field has been set.
      * signature
      * @return True if the 'signature' field has been set, false otherwise.
      */
    public boolean hasSignature() {
      return fieldSetFlags()[11];
    }


    /**
      * Clears the value of the 'signature' field.
      * signature
      * @return This builder.
      */
    public com.huawei.hwclouds.drs.avro.Record.Builder clearSignature() {
      signature = null;
      fieldSetFlags()[11] = false;
      return this;
    }

    /**
      * Gets the value of the 'transactionId' field.
      * Transaction Id
      * @return The value.
      */
    public java.lang.Long getTransactionId() {
      return transactionId;
    }


    /**
      * Sets the value of the 'transactionId' field.
      * Transaction Id
      * @param value The value of 'transactionId'.
      * @return This builder.
      */
    public com.huawei.hwclouds.drs.avro.Record.Builder setTransactionId(java.lang.Long value) {
      validate(fields()[12], value);
      this.transactionId = value;
      fieldSetFlags()[12] = true;
      return this;
    }

    /**
      * Checks whether the 'transactionId' field has been set.
      * Transaction Id
      * @return True if the 'transactionId' field has been set, false otherwise.
      */
    public boolean hasTransactionId() {
      return fieldSetFlags()[12];
    }


    /**
      * Clears the value of the 'transactionId' field.
      * Transaction Id
      * @return This builder.
      */
    public com.huawei.hwclouds.drs.avro.Record.Builder clearTransactionId() {
      transactionId = null;
      fieldSetFlags()[12] = false;
      return this;
    }

    /**
      * Gets the value of the 'rowid' field.
      * rowid
      * @return The value.
      */
    public java.lang.CharSequence getRowid() {
      return rowid;
    }


    /**
      * Sets the value of the 'rowid' field.
      * rowid
      * @param value The value of 'rowid'.
      * @return This builder.
      */
    public com.huawei.hwclouds.drs.avro.Record.Builder setRowid(java.lang.CharSequence value) {
      validate(fields()[13], value);
      this.rowid = value;
      fieldSetFlags()[13] = true;
      return this;
    }

    /**
      * Checks whether the 'rowid' field has been set.
      * rowid
      * @return True if the 'rowid' field has been set, false otherwise.
      */
    public boolean hasRowid() {
      return fieldSetFlags()[13];
    }


    /**
      * Clears the value of the 'rowid' field.
      * rowid
      * @return This builder.
      */
    public com.huawei.hwclouds.drs.avro.Record.Builder clearRowid() {
      rowid = null;
      fieldSetFlags()[13] = false;
      return this;
    }

    /**
      * Gets the value of the 'sourceDb' field.
      * mysql,oracle
      * @return The value.
      */
    public java.lang.CharSequence getSourceDb() {
      return sourceDb;
    }


    /**
      * Sets the value of the 'sourceDb' field.
      * mysql,oracle
      * @param value The value of 'sourceDb'.
      * @return This builder.
      */
    public com.huawei.hwclouds.drs.avro.Record.Builder setSourceDb(java.lang.CharSequence value) {
      validate(fields()[14], value);
      this.sourceDb = value;
      fieldSetFlags()[14] = true;
      return this;
    }

    /**
      * Checks whether the 'sourceDb' field has been set.
      * mysql,oracle
      * @return True if the 'sourceDb' field has been set, false otherwise.
      */
    public boolean hasSourceDb() {
      return fieldSetFlags()[14];
    }


    /**
      * Clears the value of the 'sourceDb' field.
      * mysql,oracle
      * @return This builder.
      */
    public com.huawei.hwclouds.drs.avro.Record.Builder clearSourceDb() {
      sourceDb = null;
      fieldSetFlags()[14] = false;
      return this;
    }

    @Override
    @SuppressWarnings("unchecked")
    public Record build() {
      try {
        Record record = new Record();
        record.version = fieldSetFlags()[0] ? this.version : (java.lang.CharSequence) defaultValue(fields()[0]);
        record.seqno = fieldSetFlags()[1] ? this.seqno : (java.lang.Long) defaultValue(fields()[1]);
        record.shardId = fieldSetFlags()[2] ? this.shardId : (java.lang.Long) defaultValue(fields()[2]);
        record.eventid = fieldSetFlags()[3] ? this.eventid : (java.lang.CharSequence) defaultValue(fields()[3]);
        record.updateTimestamp = fieldSetFlags()[4] ? this.updateTimestamp : (java.lang.Long) defaultValue(fields()[4]);
        record.tableName = fieldSetFlags()[5] ? this.tableName : (java.lang.CharSequence) defaultValue(fields()[5]);
        record.operation = fieldSetFlags()[6] ? this.operation : (java.lang.CharSequence) defaultValue(fields()[6]);
        record.columnCount = fieldSetFlags()[7] ? this.columnCount : (java.lang.Long) defaultValue(fields()[7]);
        record.fields = fieldSetFlags()[8] ? this.fields : (java.util.List<com.huawei.hwclouds.drs.avro.Field>) defaultValue(fields()[8]);
        record.beforeImages = fieldSetFlags()[9] ? this.beforeImages : (java.util.List<java.lang.Object>) defaultValue(fields()[9]);
        record.afterImages = fieldSetFlags()[10] ? this.afterImages : (java.util.List<java.lang.Object>) defaultValue(fields()[10]);
        record.signature = fieldSetFlags()[11] ? this.signature : (java.lang.CharSequence) defaultValue(fields()[11]);
        record.transactionId = fieldSetFlags()[12] ? this.transactionId : (java.lang.Long) defaultValue(fields()[12]);
        record.rowid = fieldSetFlags()[13] ? this.rowid : (java.lang.CharSequence) defaultValue(fields()[13]);
        record.sourceDb = fieldSetFlags()[14] ? this.sourceDb : (java.lang.CharSequence) defaultValue(fields()[14]);
        return record;
      } catch (org.apache.avro.AvroMissingFieldException e) {
        throw e;
      } catch (java.lang.Exception e) {
        throw new org.apache.avro.AvroRuntimeException(e);
      }
    }
  }

  @SuppressWarnings("unchecked")
  private static final org.apache.avro.io.DatumWriter<Record>
    WRITER$ = (org.apache.avro.io.DatumWriter<Record>)MODEL$.createDatumWriter(SCHEMA$);

  @Override public void writeExternal(java.io.ObjectOutput out)
    throws java.io.IOException {
    WRITER$.write(this, SpecificData.getEncoder(out));
  }

  @SuppressWarnings("unchecked")
  private static final org.apache.avro.io.DatumReader<Record>
    READER$ = (org.apache.avro.io.DatumReader<Record>)MODEL$.createDatumReader(SCHEMA$);

  @Override public void readExternal(java.io.ObjectInput in)
    throws java.io.IOException {
    READER$.read(this, SpecificData.getDecoder(in));
  }

}










