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