/** * Autogenerated by Avro * * DO NOT EDIT DIRECTLY */ package avro.complex_schema; @SuppressWarnings("all") @org.apache.avro.specific.AvroGenerated public class secondMap 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\":\"secondMap\",\"namespace\":\"avro.complex_schema\",\"fields\":[{\"name\":\"id\",\"type\":\"string\"},{\"name\":\"value\",\"type\":\"string\"},{\"name\":\"secondMap\",\"type\":\"null\",\"doc\":\"This element contains no attributes and no children.\"}]}"); public static org.apache.avro.Schema getClassSchema() { return SCHEMA$; } @Deprecated public java.lang.CharSequence id; @Deprecated public java.lang.CharSequence value; /** This element contains no attributes and no children. */ @Deprecated public java.lang.Void secondMap; /** * 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 secondMap() {} /** * All-args constructor. */ public secondMap(java.lang.CharSequence id, java.lang.CharSequence value, java.lang.Void secondMap) { this.id = id; this.value = value; this.secondMap = secondMap; } 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 id; case 1: return value; case 2: return secondMap; 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: id = (java.lang.CharSequence)value$; break; case 1: value = (java.lang.CharSequence)value$; break; case 2: secondMap = (java.lang.Void)value$; break; default: throw new org.apache.avro.AvroRuntimeException("Bad index"); } } /** * Gets the value of the 'id' field. */ public java.lang.CharSequence getId() { return id; } /** * Sets the value of the 'id' field. * @param value the value to set. */ public void setId(java.lang.CharSequence value) { this.id = value; } /** * Gets the value of the 'value' field. */ public java.lang.CharSequence getValue() { return value; } /** * Sets the value of the 'value' field. * @param value the value to set. */ public void setValue(java.lang.CharSequence value) { this.value = value; } /** * Gets the value of the 'secondMap' field. * This element contains no attributes and no children. */ public java.lang.Void getSecondMap() { return secondMap; } /** * Sets the value of the 'secondMap' field. * This element contains no attributes and no children. * @param value the value to set. */ public void setSecondMap(java.lang.Void value) { this.secondMap = value; } /** Creates a new secondMap RecordBuilder */ public static avro.complex_schema.secondMap.Builder newBuilder() { return new avro.complex_schema.secondMap.Builder(); } /** Creates a new secondMap RecordBuilder by copying an existing Builder */ public static avro.complex_schema.secondMap.Builder newBuilder(avro.complex_schema.secondMap.Builder other) { return new avro.complex_schema.secondMap.Builder(other); } /** Creates a new secondMap RecordBuilder by copying an existing secondMap instance */ public static avro.complex_schema.secondMap.Builder newBuilder(avro.complex_schema.secondMap other) { return new avro.complex_schema.secondMap.Builder(other); } /** * RecordBuilder for secondMap instances. */ public static class Builder extends org.apache.avro.specific.SpecificRecordBuilderBase<secondMap> implements org.apache.avro.data.RecordBuilder<secondMap> { private java.lang.CharSequence id; private java.lang.CharSequence value; private java.lang.Void secondMap; /** Creates a new Builder */ private Builder() { super(avro.complex_schema.secondMap.SCHEMA$); } /** Creates a Builder by copying an existing Builder */ private Builder(avro.complex_schema.secondMap.Builder other) { super(other); if (isValidValue(fields()[0], other.id)) { this.id = data().deepCopy(fields()[0].schema(), other.id); fieldSetFlags()[0] = true; } if (isValidValue(fields()[1], other.value)) { this.value = data().deepCopy(fields()[1].schema(), other.value); fieldSetFlags()[1] = true; } if (isValidValue(fields()[2], other.secondMap)) { this.secondMap = data().deepCopy(fields()[2].schema(), other.secondMap); fieldSetFlags()[2] = true; } } /** Creates a Builder by copying an existing secondMap instance */ private Builder(avro.complex_schema.secondMap other) { super(avro.complex_schema.secondMap.SCHEMA$); if (isValidValue(fields()[0], other.id)) { this.id = data().deepCopy(fields()[0].schema(), other.id); fieldSetFlags()[0] = true; } if (isValidValue(fields()[1], other.value)) { this.value = data().deepCopy(fields()[1].schema(), other.value); fieldSetFlags()[1] = true; } if (isValidValue(fields()[2], other.secondMap)) { this.secondMap = data().deepCopy(fields()[2].schema(), other.secondMap); fieldSetFlags()[2] = true; } } /** Gets the value of the 'id' field */ public java.lang.CharSequence getId() { return id; } /** Sets the value of the 'id' field */ public avro.complex_schema.secondMap.Builder setId(java.lang.CharSequence value) { validate(fields()[0], value); this.id = value; fieldSetFlags()[0] = true; return this; } /** Checks whether the 'id' field has been set */ public boolean hasId() { return fieldSetFlags()[0]; } /** Clears the value of the 'id' field */ public avro.complex_schema.secondMap.Builder clearId() { id = null; fieldSetFlags()[0] = false; return this; } /** Gets the value of the 'value' field */ public java.lang.CharSequence getValue() { return value; } /** Sets the value of the 'value' field */ public avro.complex_schema.secondMap.Builder setValue(java.lang.CharSequence value) { validate(fields()[1], value); this.value = value; fieldSetFlags()[1] = true; return this; } /** Checks whether the 'value' field has been set */ public boolean hasValue() { return fieldSetFlags()[1]; } /** Clears the value of the 'value' field */ public avro.complex_schema.secondMap.Builder clearValue() { value = null; fieldSetFlags()[1] = false; return this; } /** Gets the value of the 'secondMap' field */ public java.lang.Void getSecondMap() { return secondMap; } /** Sets the value of the 'secondMap' field */ public avro.complex_schema.secondMap.Builder setSecondMap(java.lang.Void value) { validate(fields()[2], value); this.secondMap = value; fieldSetFlags()[2] = true; return this; } /** Checks whether the 'secondMap' field has been set */ public boolean hasSecondMap() { return fieldSetFlags()[2]; } /** Clears the value of the 'secondMap' field */ public avro.complex_schema.secondMap.Builder clearSecondMap() { secondMap = null; fieldSetFlags()[2] = false; return this; } @Override public secondMap build() { try { secondMap record = new secondMap(); record.id = fieldSetFlags()[0] ? this.id : (java.lang.CharSequence) defaultValue(fields()[0]); record.value = fieldSetFlags()[1] ? this.value : (java.lang.CharSequence) defaultValue(fields()[1]); record.secondMap = fieldSetFlags()[2] ? this.secondMap : (java.lang.Void) defaultValue(fields()[2]); return record; } catch (Exception e) { throw new org.apache.avro.AvroRuntimeException(e); } } } }