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