/** * Autogenerated by Avro * * DO NOT EDIT DIRECTLY */ package avro.complex_schema; @SuppressWarnings("all") @org.apache.avro.specific.AvroGenerated public class avroEnum 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\":\"avroEnum\",\"namespace\":\"avro.complex_schema\",\"fields\":[{\"name\":\"avroEnum\",\"type\":{\"type\":\"enum\",\"name\":\"avroEnum\",\"namespace\":\"avro.complex_schema.enums\",\"doc\":\"Enumeration of symbols in {urn:avro:complex_schema}avroEnum\",\"symbols\":[\"xml\",\"json\",\"avro\",\"thrift\",\"protobuf\",\"rest_li\"]},\"doc\":\"Simple type {http://www.w3.org/2001/XMLSchema}anyType\"}]}"); public static org.apache.avro.Schema getClassSchema() { return SCHEMA$; } /** Simple type {http://www.w3.org/2001/XMLSchema}anyType */ @Deprecated public avro.complex_schema.enums.avroEnum avroEnum; /** * 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 avroEnum() {} /** * All-args constructor. */ public avroEnum(avro.complex_schema.enums.avroEnum avroEnum) { this.avroEnum = avroEnum; } 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 avroEnum; 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: avroEnum = (avro.complex_schema.enums.avroEnum)value$; break; default: throw new org.apache.avro.AvroRuntimeException("Bad index"); } } /** * Gets the value of the 'avroEnum' field. * Simple type {http://www.w3.org/2001/XMLSchema}anyType */ public avro.complex_schema.enums.avroEnum getAvroEnum() { return avroEnum; } /** * Sets the value of the 'avroEnum' field. * Simple type {http://www.w3.org/2001/XMLSchema}anyType * @param value the value to set. */ public void setAvroEnum(avro.complex_schema.enums.avroEnum value) { this.avroEnum = value; } /** Creates a new avroEnum RecordBuilder */ public static avro.complex_schema.avroEnum.Builder newBuilder() { return new avro.complex_schema.avroEnum.Builder(); } /** Creates a new avroEnum RecordBuilder by copying an existing Builder */ public static avro.complex_schema.avroEnum.Builder newBuilder(avro.complex_schema.avroEnum.Builder other) { return new avro.complex_schema.avroEnum.Builder(other); } /** Creates a new avroEnum RecordBuilder by copying an existing avroEnum instance */ public static avro.complex_schema.avroEnum.Builder newBuilder(avro.complex_schema.avroEnum other) { return new avro.complex_schema.avroEnum.Builder(other); } /** * RecordBuilder for avroEnum instances. */ public static class Builder extends org.apache.avro.specific.SpecificRecordBuilderBase<avroEnum> implements org.apache.avro.data.RecordBuilder<avroEnum> { private avro.complex_schema.enums.avroEnum avroEnum; /** Creates a new Builder */ private Builder() { super(avro.complex_schema.avroEnum.SCHEMA$); } /** Creates a Builder by copying an existing Builder */ private Builder(avro.complex_schema.avroEnum.Builder other) { super(other); if (isValidValue(fields()[0], other.avroEnum)) { this.avroEnum = data().deepCopy(fields()[0].schema(), other.avroEnum); fieldSetFlags()[0] = true; } } /** Creates a Builder by copying an existing avroEnum instance */ private Builder(avro.complex_schema.avroEnum other) { super(avro.complex_schema.avroEnum.SCHEMA$); if (isValidValue(fields()[0], other.avroEnum)) { this.avroEnum = data().deepCopy(fields()[0].schema(), other.avroEnum); fieldSetFlags()[0] = true; } } /** Gets the value of the 'avroEnum' field */ public avro.complex_schema.enums.avroEnum getAvroEnum() { return avroEnum; } /** Sets the value of the 'avroEnum' field */ public avro.complex_schema.avroEnum.Builder setAvroEnum(avro.complex_schema.enums.avroEnum value) { validate(fields()[0], value); this.avroEnum = value; fieldSetFlags()[0] = true; return this; } /** Checks whether the 'avroEnum' field has been set */ public boolean hasAvroEnum() { return fieldSetFlags()[0]; } /** Clears the value of the 'avroEnum' field */ public avro.complex_schema.avroEnum.Builder clearAvroEnum() { avroEnum = null; fieldSetFlags()[0] = false; return this; } @Override public avroEnum build() { try { avroEnum record = new avroEnum(); record.avroEnum = fieldSetFlags()[0] ? this.avroEnum : (avro.complex_schema.enums.avroEnum) defaultValue(fields()[0]); return record; } catch (Exception e) { throw new org.apache.avro.AvroRuntimeException(e); } } } }