/** * Autogenerated by Avro * * DO NOT EDIT DIRECTLY */ package com.flipkart.aesop.events.sample.person; @SuppressWarnings("all") @org.apache.avro.specific.AvroGenerated public class FieldChange extends org.apache.avro.specific.SpecificRecordBase implements org.apache.avro.specific.SpecificRecord { public static final org.apache.avro.Schema SCHEMA$ = new org.apache.avro.Schema.Parser().parse("{\"type\":\"record\",\"name\":\"FieldChange\",\"namespace\":\"com.flipkart.aesop.events.sample.person\",\"fields\":[{\"name\":\"name\",\"type\":\"string\"},{\"name\":\"oldValue\",\"type\":\"string\"},{\"name\":\"newValue\",\"type\":\"string\"}]}"); public static org.apache.avro.Schema getClassSchema() { return SCHEMA$; } @Deprecated public java.lang.CharSequence name; @Deprecated public java.lang.CharSequence oldValue; @Deprecated public java.lang.CharSequence newValue; /** * Default constructor. Note that this does not initialize fields * to their default values from the schema. If that is desired then * one should use {@link \#newBuilder()}. */ public FieldChange() {} /** * All-args constructor. */ public FieldChange(java.lang.CharSequence name, java.lang.CharSequence oldValue, java.lang.CharSequence newValue) { this.name = name; this.oldValue = oldValue; this.newValue = newValue; } 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 name; case 1: return oldValue; case 2: return newValue; 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: name = (java.lang.CharSequence)value$; break; case 1: oldValue = (java.lang.CharSequence)value$; break; case 2: newValue = (java.lang.CharSequence)value$; break; default: throw new org.apache.avro.AvroRuntimeException("Bad index"); } } /** * Gets the value of the 'name' field. */ public java.lang.CharSequence getName() { return name; } /** * Sets the value of the 'name' field. * @param value the value to set. */ public void setName(java.lang.CharSequence value) { this.name = value; } /** * Gets the value of the 'oldValue' field. */ public java.lang.CharSequence getOldValue() { return oldValue; } /** * Sets the value of the 'oldValue' field. * @param value the value to set. */ public void setOldValue(java.lang.CharSequence value) { this.oldValue = value; } /** * Gets the value of the 'newValue' field. */ public java.lang.CharSequence getNewValue() { return newValue; } /** * Sets the value of the 'newValue' field. * @param value the value to set. */ public void setNewValue(java.lang.CharSequence value) { this.newValue = value; } /** Creates a new FieldChange RecordBuilder */ public static com.flipkart.aesop.events.sample.person.FieldChange.Builder newBuilder() { return new com.flipkart.aesop.events.sample.person.FieldChange.Builder(); } /** Creates a new FieldChange RecordBuilder by copying an existing Builder */ public static com.flipkart.aesop.events.sample.person.FieldChange.Builder newBuilder(com.flipkart.aesop.events.sample.person.FieldChange.Builder other) { return new com.flipkart.aesop.events.sample.person.FieldChange.Builder(other); } /** Creates a new FieldChange RecordBuilder by copying an existing FieldChange instance */ public static com.flipkart.aesop.events.sample.person.FieldChange.Builder newBuilder(com.flipkart.aesop.events.sample.person.FieldChange other) { return new com.flipkart.aesop.events.sample.person.FieldChange.Builder(other); } /** * RecordBuilder for FieldChange instances. */ public static class Builder extends org.apache.avro.specific.SpecificRecordBuilderBase<FieldChange> implements org.apache.avro.data.RecordBuilder<FieldChange> { private java.lang.CharSequence name; private java.lang.CharSequence oldValue; private java.lang.CharSequence newValue; /** Creates a new Builder */ private Builder() { super(com.flipkart.aesop.events.sample.person.FieldChange.SCHEMA$); } /** Creates a Builder by copying an existing Builder */ private Builder(com.flipkart.aesop.events.sample.person.FieldChange.Builder other) { super(other); if (isValidValue(fields()[0], other.name)) { this.name = data().deepCopy(fields()[0].schema(), other.name); fieldSetFlags()[0] = true; } if (isValidValue(fields()[1], other.oldValue)) { this.oldValue = data().deepCopy(fields()[1].schema(), other.oldValue); fieldSetFlags()[1] = true; } if (isValidValue(fields()[2], other.newValue)) { this.newValue = data().deepCopy(fields()[2].schema(), other.newValue); fieldSetFlags()[2] = true; } } /** Creates a Builder by copying an existing FieldChange instance */ private Builder(com.flipkart.aesop.events.sample.person.FieldChange other) { super(com.flipkart.aesop.events.sample.person.FieldChange.SCHEMA$); if (isValidValue(fields()[0], other.name)) { this.name = data().deepCopy(fields()[0].schema(), other.name); fieldSetFlags()[0] = true; } if (isValidValue(fields()[1], other.oldValue)) { this.oldValue = data().deepCopy(fields()[1].schema(), other.oldValue); fieldSetFlags()[1] = true; } if (isValidValue(fields()[2], other.newValue)) { this.newValue = data().deepCopy(fields()[2].schema(), other.newValue); fieldSetFlags()[2] = true; } } /** Gets the value of the 'name' field */ public java.lang.CharSequence getName() { return name; } /** Sets the value of the 'name' field */ public com.flipkart.aesop.events.sample.person.FieldChange.Builder setName(java.lang.CharSequence value) { validate(fields()[0], value); this.name = value; fieldSetFlags()[0] = true; return this; } /** Checks whether the 'name' field has been set */ public boolean hasName() { return fieldSetFlags()[0]; } /** Clears the value of the 'name' field */ public com.flipkart.aesop.events.sample.person.FieldChange.Builder clearName() { name = null; fieldSetFlags()[0] = false; return this; } /** Gets the value of the 'oldValue' field */ public java.lang.CharSequence getOldValue() { return oldValue; } /** Sets the value of the 'oldValue' field */ public com.flipkart.aesop.events.sample.person.FieldChange.Builder setOldValue(java.lang.CharSequence value) { validate(fields()[1], value); this.oldValue = value; fieldSetFlags()[1] = true; return this; } /** Checks whether the 'oldValue' field has been set */ public boolean hasOldValue() { return fieldSetFlags()[1]; } /** Clears the value of the 'oldValue' field */ public com.flipkart.aesop.events.sample.person.FieldChange.Builder clearOldValue() { oldValue = null; fieldSetFlags()[1] = false; return this; } /** Gets the value of the 'newValue' field */ public java.lang.CharSequence getNewValue() { return newValue; } /** Sets the value of the 'newValue' field */ public com.flipkart.aesop.events.sample.person.FieldChange.Builder setNewValue(java.lang.CharSequence value) { validate(fields()[2], value); this.newValue = value; fieldSetFlags()[2] = true; return this; } /** Checks whether the 'newValue' field has been set */ public boolean hasNewValue() { return fieldSetFlags()[2]; } /** Clears the value of the 'newValue' field */ public com.flipkart.aesop.events.sample.person.FieldChange.Builder clearNewValue() { newValue = null; fieldSetFlags()[2] = false; return this; } @Override public FieldChange build() { try { FieldChange record = new FieldChange(); record.name = fieldSetFlags()[0] ? this.name : (java.lang.CharSequence) defaultValue(fields()[0]); record.oldValue = fieldSetFlags()[1] ? this.oldValue : (java.lang.CharSequence) defaultValue(fields()[1]); record.newValue = fieldSetFlags()[2] ? this.newValue : (java.lang.CharSequence) defaultValue(fields()[2]); return record; } catch (Exception e) { throw new org.apache.avro.AvroRuntimeException(e); } } } }