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