/** * Autogenerated by Avro * * DO NOT EDIT DIRECTLY */ package avro.complex_schema; @SuppressWarnings("all") @org.apache.avro.specific.AvroGenerated public class firstMap 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\":\"firstMap\",\"namespace\":\"avro.complex_schema\",\"fields\":[{\"name\":\"id\",\"type\":\"string\"},{\"name\":\"firstMap\",\"type\":{\"type\":\"array\",\"items\":[{\"type\":\"record\",\"name\":\"value\",\"fields\":[{\"name\":\"value\",\"type\":[{\"type\":\"bytes\",\"logicalType\":\"decimal\",\"scale\":0,\"precision\":34},\"null\"],\"doc\":\"Simple type {http://www.w3.org/2001/XMLSchema}decimal\"}]}]},\"doc\":\"Children of {urn:avro:complex_schema}firstMap\"}]}"); public static org.apache.avro.Schema getClassSchema() { return SCHEMA$; } @Deprecated public java.lang.CharSequence id; /** Children of {urn:avro:complex_schema}firstMap */ @Deprecated public java.util.List<java.lang.Object> firstMap; /** * 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 firstMap() {} /** * All-args constructor. */ public firstMap(java.lang.CharSequence id, java.util.List<java.lang.Object> firstMap) { this.id = id; this.firstMap = firstMap; } 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 firstMap; 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: firstMap = (java.util.List<java.lang.Object>)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 'firstMap' field. * Children of {urn:avro:complex_schema}firstMap */ public java.util.List<java.lang.Object> getFirstMap() { return firstMap; } /** * Sets the value of the 'firstMap' field. * Children of {urn:avro:complex_schema}firstMap * @param value the value to set. */ public void setFirstMap(java.util.List<java.lang.Object> value) { this.firstMap = value; } /** Creates a new firstMap RecordBuilder */ public static avro.complex_schema.firstMap.Builder newBuilder() { return new avro.complex_schema.firstMap.Builder(); } /** Creates a new firstMap RecordBuilder by copying an existing Builder */ public static avro.complex_schema.firstMap.Builder newBuilder(avro.complex_schema.firstMap.Builder other) { return new avro.complex_schema.firstMap.Builder(other); } /** Creates a new firstMap RecordBuilder by copying an existing firstMap instance */ public static avro.complex_schema.firstMap.Builder newBuilder(avro.complex_schema.firstMap other) { return new avro.complex_schema.firstMap.Builder(other); } /** * RecordBuilder for firstMap instances. */ public static class Builder extends org.apache.avro.specific.SpecificRecordBuilderBase<firstMap> implements org.apache.avro.data.RecordBuilder<firstMap> { private java.lang.CharSequence id; private java.util.List<java.lang.Object> firstMap; /** Creates a new Builder */ private Builder() { super(avro.complex_schema.firstMap.SCHEMA$); } /** Creates a Builder by copying an existing Builder */ private Builder(avro.complex_schema.firstMap.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.firstMap)) { this.firstMap = data().deepCopy(fields()[1].schema(), other.firstMap); fieldSetFlags()[1] = true; } } /** Creates a Builder by copying an existing firstMap instance */ private Builder(avro.complex_schema.firstMap other) { super(avro.complex_schema.firstMap.SCHEMA$); if (isValidValue(fields()[0], other.id)) { this.id = data().deepCopy(fields()[0].schema(), other.id); fieldSetFlags()[0] = true; } if (isValidValue(fields()[1], other.firstMap)) { this.firstMap = data().deepCopy(fields()[1].schema(), other.firstMap); fieldSetFlags()[1] = 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.firstMap.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.firstMap.Builder clearId() { id = null; fieldSetFlags()[0] = false; return this; } /** Gets the value of the 'firstMap' field */ public java.util.List<java.lang.Object> getFirstMap() { return firstMap; } /** Sets the value of the 'firstMap' field */ public avro.complex_schema.firstMap.Builder setFirstMap(java.util.List<java.lang.Object> value) { validate(fields()[1], value); this.firstMap = value; fieldSetFlags()[1] = true; return this; } /** Checks whether the 'firstMap' field has been set */ public boolean hasFirstMap() { return fieldSetFlags()[1]; } /** Clears the value of the 'firstMap' field */ public avro.complex_schema.firstMap.Builder clearFirstMap() { firstMap = null; fieldSetFlags()[1] = false; return this; } @Override public firstMap build() { try { firstMap record = new firstMap(); record.id = fieldSetFlags()[0] ? this.id : (java.lang.CharSequence) defaultValue(fields()[0]); record.firstMap = fieldSetFlags()[1] ? this.firstMap : (java.util.List<java.lang.Object>) defaultValue(fields()[1]); return record; } catch (Exception e) { throw new org.apache.avro.AvroRuntimeException(e); } } } }