/**
* Autogenerated by Avro
*
* DO NOT EDIT DIRECTLY
*/
package avro.complex_schema;
@SuppressWarnings("all")
@org.apache.avro.specific.AvroGenerated
public class simpleExtension 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\":\"simpleExtension\",\"namespace\":\"avro.complex_schema\",\"fields\":[{\"name\":\"default\",\"type\":\"string\"},{\"name\":\"fixed\",\"type\":\"int\"},{\"name\":\"simpleExtension\",\"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 simpleExtension;
/**
* 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 simpleExtension() {}
/**
* All-args constructor.
*/
public simpleExtension(java.lang.CharSequence default$, java.lang.Integer fixed, java.lang.Object simpleExtension) {
this.default$ = default$;
this.fixed = fixed;
this.simpleExtension = simpleExtension;
}
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 simpleExtension;
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: simpleExtension = (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 'simpleExtension' field.
* Simple type null */
public java.lang.Object getSimpleExtension() {
return simpleExtension;
}
/**
* Sets the value of the 'simpleExtension' field.
* Simple type null * @param value the value to set.
*/
public void setSimpleExtension(java.lang.Object value) {
this.simpleExtension = value;
}
/** Creates a new simpleExtension RecordBuilder */
public static avro.complex_schema.simpleExtension.Builder newBuilder() {
return new avro.complex_schema.simpleExtension.Builder();
}
/** Creates a new simpleExtension RecordBuilder by copying an existing Builder */
public static avro.complex_schema.simpleExtension.Builder newBuilder(avro.complex_schema.simpleExtension.Builder other) {
return new avro.complex_schema.simpleExtension.Builder(other);
}
/** Creates a new simpleExtension RecordBuilder by copying an existing simpleExtension instance */
public static avro.complex_schema.simpleExtension.Builder newBuilder(avro.complex_schema.simpleExtension other) {
return new avro.complex_schema.simpleExtension.Builder(other);
}
/**
* RecordBuilder for simpleExtension instances.
*/
public static class Builder extends org.apache.avro.specific.SpecificRecordBuilderBase<simpleExtension>
implements org.apache.avro.data.RecordBuilder<simpleExtension> {
private java.lang.CharSequence default$;
private int fixed;
private java.lang.Object simpleExtension;
/** Creates a new Builder */
private Builder() {
super(avro.complex_schema.simpleExtension.SCHEMA$);
}
/** Creates a Builder by copying an existing Builder */
private Builder(avro.complex_schema.simpleExtension.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.simpleExtension)) {
this.simpleExtension = data().deepCopy(fields()[2].schema(), other.simpleExtension);
fieldSetFlags()[2] = true;
}
}
/** Creates a Builder by copying an existing simpleExtension instance */
private Builder(avro.complex_schema.simpleExtension other) {
super(avro.complex_schema.simpleExtension.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.simpleExtension)) {
this.simpleExtension = data().deepCopy(fields()[2].schema(), other.simpleExtension);
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.simpleExtension.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.simpleExtension.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.simpleExtension.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.simpleExtension.Builder clearFixed() {
fieldSetFlags()[1] = false;
return this;
}
/** Gets the value of the 'simpleExtension' field */
public java.lang.Object getSimpleExtension() {
return simpleExtension;
}
/** Sets the value of the 'simpleExtension' field */
public avro.complex_schema.simpleExtension.Builder setSimpleExtension(java.lang.Object value) {
validate(fields()[2], value);
this.simpleExtension = value;
fieldSetFlags()[2] = true;
return this;
}
/** Checks whether the 'simpleExtension' field has been set */
public boolean hasSimpleExtension() {
return fieldSetFlags()[2];
}
/** Clears the value of the 'simpleExtension' field */
public avro.complex_schema.simpleExtension.Builder clearSimpleExtension() {
simpleExtension = null;
fieldSetFlags()[2] = false;
return this;
}
@Override
public simpleExtension build() {
try {
simpleExtension record = new simpleExtension();
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.simpleExtension = fieldSetFlags()[2] ? this.simpleExtension : (java.lang.Object) defaultValue(fields()[2]);
return record;
} catch (Exception e) {
throw new org.apache.avro.AvroRuntimeException(e);
}
}
}
}