/**
* Autogenerated by Avro
*
* DO NOT EDIT DIRECTLY
*/
package avro.complex_schema;
@SuppressWarnings("all")
@org.apache.avro.specific.AvroGenerated
public class realRoot 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\":\"realRoot\",\"namespace\":\"avro.complex_schema\",\"fields\":[{\"name\":\"month\",\"type\":\"string\"},{\"name\":\"year\",\"type\":\"string\"},{\"name\":\"day\",\"type\":\"string\"},{\"name\":\"realRoot\",\"type\":{\"type\":\"array\",\"items\":[{\"type\":\"record\",\"name\":\"backtrack\",\"doc\":\" This forces backtracking through the different schema options. Consider the following elements: <backtrack> <qName>avro:qName</qName> <avroEnum>avro</avroEnum> <xmlEnum>rest.li</xmlEnum> <xmlEnum>xml</xmlEnum> <unsignedLongList>18446744073709551615 1844674407370955 12579</unsignedLongList> <listOfUnion>true 18446744073709551616 false -2147483648 -1234.567 avro</listOfUnion> </backtrack> The first four elements in the list can match either the first choice group or the second sequence group, and by default the first branch will be taken. It is not until the last child element, <listOfUnion>, is reached, that it becomes clear the choice group should not be followed. \",\"fields\":[{\"name\":\"backtrack\",\"type\":{\"type\":\"array\",\"items\":[{\"type\":\"record\",\"name\":\"qName\",\"fields\":[{\"name\":\"qName\",\"type\":{\"type\":\"record\",\"name\":\"qName\",\"namespace\":\"org.w3.www._2001.xmlschema\",\"doc\":\"Qualified Name\",\"fields\":[{\"name\":\"namespace\",\"type\":\"string\",\"doc\":\"The namespace of this qualified name.\"},{\"name\":\"localPart\",\"type\":\"string\",\"doc\":\"The local part of this qualified name.\"}]},\"doc\":\"Simple type {http://www.w3.org/2001/XMLSchema}QName\"}]},{\"type\":\"record\",\"name\":\"avroEnum\",\"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\"}]},{\"type\":\"record\",\"name\":\"xmlEnum\",\"fields\":[{\"name\":\"xmlEnum\",\"type\":\"string\",\"doc\":\"Simple type {http://www.w3.org/2001/XMLSchema}anyType\"}]},{\"type\":\"record\",\"name\":\"unsignedLongList\",\"fields\":[{\"name\":\"unsignedLongList\",\"type\":{\"type\":\"array\",\"items\":{\"type\":\"bytes\",\"logicalType\":\"decimal\",\"scale\":0,\"precision\":34}},\"doc\":\"Simple type null\"}]},{\"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\"}]}]},\"doc\":\"Children of {urn:avro:complex_schema}backtrack\"}]},{\"type\":\"map\",\"values\":{\"type\":\"record\",\"name\":\"allTheThings\",\"doc\":\" This is a map containing a map of a union of firstMap and secondMap. The maps are generated as all three have a single required attribute of type ID. The inner two maps become a union because a union of two map types is not allowed. Likewise, the map itself must become a union of two other types. \",\"fields\":[{\"name\":\"truth\",\"type\":\"boolean\"},{\"name\":\"id\",\"type\":\"string\"},{\"name\":\"listOfNumbers\",\"type\":{\"type\":\"array\",\"items\":[\"int\",{\"type\":\"bytes\",\"logicalType\":\"decimal\",\"scale\":0,\"precision\":34}]}},{\"name\":\"allTheThings\",\"type\":{\"type\":\"array\",\"items\":[{\"type\":\"map\",\"values\":[{\"type\":\"record\",\"name\":\"firstMap\",\"fields\":[{\"name\":\"id\",\"type\":\"string\"},{\"name\":\"firstMap\",\"type\":{\"type\":\"array\",\"items\":[{\"type\":\"record\",\"name\":\"value\",\"fields\":[{\"name\":\"value\",\"type\":[{\"type\":\"bytes\",\"logicalType\":\"decimal\",\"scale\":0,\"precision\":34},\"null\"],\"doc\":\"Simple type {http://www.w3.org/2001/XMLSchema}decimal\"}]}]},\"doc\":\"Children of {urn:avro:complex_schema}firstMap\"}]},{\"type\":\"record\",\"name\":\"secondMap\",\"fields\":[{\"name\":\"id\",\"type\":\"string\"},{\"name\":\"value\",\"type\":\"string\"},{\"name\":\"secondMap\",\"type\":\"null\",\"doc\":\"This element contains no attributes and no children.\"}]}]}]},\"doc\":\"Children of {urn:avro:complex_schema}allTheThings\"}]}},{\"type\":\"record\",\"name\":\"prohibit\",\"fields\":[{\"name\":\"prohibit\",\"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\"}]}]},\"doc\":\"Children of {urn:avro:complex_schema}prohibit\"}]},{\"type\":\"record\",\"name\":\"anyAndFriends\",\"fields\":[{\"name\":\"anyAndFriends\",\"type\":\"string\",\"doc\":\"Simple type null\"}]},{\"type\":\"record\",\"name\":\"simpleExtension\",\"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\"}]},{\"type\":\"record\",\"name\":\"simpleRestriction\",\"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\"}]},{\"type\":\"record\",\"name\":\"complexExtension\",\"fields\":[{\"name\":\"optional\",\"type\":[\"string\",\"null\"]},{\"name\":\"defaulted\",\"type\":\"string\"},{\"name\":\"complexExtension\",\"type\":{\"type\":\"array\",\"items\":[\"fixed\",\"listOfUnion\",\"unsignedLongList\"]},\"doc\":\"Children of {urn:avro:complex_schema}complexExtension\"}]},{\"type\":\"record\",\"name\":\"mixedType\",\"fields\":[{\"name\":\"mixedType\",\"type\":{\"type\":\"array\",\"items\":[\"listOfUnion\",\"unsignedLongList\",\"string\"]},\"doc\":\"Children of {urn:avro:complex_schema}mixedType\"}]}]},\"doc\":\"Children of {urn:avro:complex_schema}realRoot\"}],\"xmlSchemas\":{\"files\":[\"C:\\\\Users\\\\Mike Pigott\\\\git\\\\xml-to-avro\\\\avro-to-xml\\\\src\\\\test\\\\resources\\\\complex_schema.xsd\"],\"baseUri\":\"http://www.test.com/AvroTest\",\"rootTag\":{\"namespace\":\"urn:avro:complex_schema\",\"localPart\":\"root\"}}}");
public static org.apache.avro.Schema getClassSchema() { return SCHEMA$; }
@Deprecated public java.lang.CharSequence month;
@Deprecated public java.lang.CharSequence year;
@Deprecated public java.lang.CharSequence day;
/** Children of {urn:avro:complex_schema}realRoot */
@Deprecated public java.util.List<java.lang.Object> realRoot;
/**
* 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 realRoot() {}
/**
* All-args constructor.
*/
public realRoot(java.lang.CharSequence month, java.lang.CharSequence year, java.lang.CharSequence day, java.util.List<java.lang.Object> realRoot) {
this.month = month;
this.year = year;
this.day = day;
this.realRoot = realRoot;
}
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 month;
case 1: return year;
case 2: return day;
case 3: return realRoot;
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: month = (java.lang.CharSequence)value$; break;
case 1: year = (java.lang.CharSequence)value$; break;
case 2: day = (java.lang.CharSequence)value$; break;
case 3: realRoot = (java.util.List<java.lang.Object>)value$; break;
default: throw new org.apache.avro.AvroRuntimeException("Bad index");
}
}
/**
* Gets the value of the 'month' field.
*/
public java.lang.CharSequence getMonth() {
return month;
}
/**
* Sets the value of the 'month' field.
* @param value the value to set.
*/
public void setMonth(java.lang.CharSequence value) {
this.month = value;
}
/**
* Gets the value of the 'year' field.
*/
public java.lang.CharSequence getYear() {
return year;
}
/**
* Sets the value of the 'year' field.
* @param value the value to set.
*/
public void setYear(java.lang.CharSequence value) {
this.year = value;
}
/**
* Gets the value of the 'day' field.
*/
public java.lang.CharSequence getDay() {
return day;
}
/**
* Sets the value of the 'day' field.
* @param value the value to set.
*/
public void setDay(java.lang.CharSequence value) {
this.day = value;
}
/**
* Gets the value of the 'realRoot' field.
* Children of {urn:avro:complex_schema}realRoot */
public java.util.List<java.lang.Object> getRealRoot() {
return realRoot;
}
/**
* Sets the value of the 'realRoot' field.
* Children of {urn:avro:complex_schema}realRoot * @param value the value to set.
*/
public void setRealRoot(java.util.List<java.lang.Object> value) {
this.realRoot = value;
}
/** Creates a new realRoot RecordBuilder */
public static avro.complex_schema.realRoot.Builder newBuilder() {
return new avro.complex_schema.realRoot.Builder();
}
/** Creates a new realRoot RecordBuilder by copying an existing Builder */
public static avro.complex_schema.realRoot.Builder newBuilder(avro.complex_schema.realRoot.Builder other) {
return new avro.complex_schema.realRoot.Builder(other);
}
/** Creates a new realRoot RecordBuilder by copying an existing realRoot instance */
public static avro.complex_schema.realRoot.Builder newBuilder(avro.complex_schema.realRoot other) {
return new avro.complex_schema.realRoot.Builder(other);
}
/**
* RecordBuilder for realRoot instances.
*/
public static class Builder extends org.apache.avro.specific.SpecificRecordBuilderBase<realRoot>
implements org.apache.avro.data.RecordBuilder<realRoot> {
private java.lang.CharSequence month;
private java.lang.CharSequence year;
private java.lang.CharSequence day;
private java.util.List<java.lang.Object> realRoot;
/** Creates a new Builder */
private Builder() {
super(avro.complex_schema.realRoot.SCHEMA$);
}
/** Creates a Builder by copying an existing Builder */
private Builder(avro.complex_schema.realRoot.Builder other) {
super(other);
if (isValidValue(fields()[0], other.month)) {
this.month = data().deepCopy(fields()[0].schema(), other.month);
fieldSetFlags()[0] = true;
}
if (isValidValue(fields()[1], other.year)) {
this.year = data().deepCopy(fields()[1].schema(), other.year);
fieldSetFlags()[1] = true;
}
if (isValidValue(fields()[2], other.day)) {
this.day = data().deepCopy(fields()[2].schema(), other.day);
fieldSetFlags()[2] = true;
}
if (isValidValue(fields()[3], other.realRoot)) {
this.realRoot = data().deepCopy(fields()[3].schema(), other.realRoot);
fieldSetFlags()[3] = true;
}
}
/** Creates a Builder by copying an existing realRoot instance */
private Builder(avro.complex_schema.realRoot other) {
super(avro.complex_schema.realRoot.SCHEMA$);
if (isValidValue(fields()[0], other.month)) {
this.month = data().deepCopy(fields()[0].schema(), other.month);
fieldSetFlags()[0] = true;
}
if (isValidValue(fields()[1], other.year)) {
this.year = data().deepCopy(fields()[1].schema(), other.year);
fieldSetFlags()[1] = true;
}
if (isValidValue(fields()[2], other.day)) {
this.day = data().deepCopy(fields()[2].schema(), other.day);
fieldSetFlags()[2] = true;
}
if (isValidValue(fields()[3], other.realRoot)) {
this.realRoot = data().deepCopy(fields()[3].schema(), other.realRoot);
fieldSetFlags()[3] = true;
}
}
/** Gets the value of the 'month' field */
public java.lang.CharSequence getMonth() {
return month;
}
/** Sets the value of the 'month' field */
public avro.complex_schema.realRoot.Builder setMonth(java.lang.CharSequence value) {
validate(fields()[0], value);
this.month = value;
fieldSetFlags()[0] = true;
return this;
}
/** Checks whether the 'month' field has been set */
public boolean hasMonth() {
return fieldSetFlags()[0];
}
/** Clears the value of the 'month' field */
public avro.complex_schema.realRoot.Builder clearMonth() {
month = null;
fieldSetFlags()[0] = false;
return this;
}
/** Gets the value of the 'year' field */
public java.lang.CharSequence getYear() {
return year;
}
/** Sets the value of the 'year' field */
public avro.complex_schema.realRoot.Builder setYear(java.lang.CharSequence value) {
validate(fields()[1], value);
this.year = value;
fieldSetFlags()[1] = true;
return this;
}
/** Checks whether the 'year' field has been set */
public boolean hasYear() {
return fieldSetFlags()[1];
}
/** Clears the value of the 'year' field */
public avro.complex_schema.realRoot.Builder clearYear() {
year = null;
fieldSetFlags()[1] = false;
return this;
}
/** Gets the value of the 'day' field */
public java.lang.CharSequence getDay() {
return day;
}
/** Sets the value of the 'day' field */
public avro.complex_schema.realRoot.Builder setDay(java.lang.CharSequence value) {
validate(fields()[2], value);
this.day = value;
fieldSetFlags()[2] = true;
return this;
}
/** Checks whether the 'day' field has been set */
public boolean hasDay() {
return fieldSetFlags()[2];
}
/** Clears the value of the 'day' field */
public avro.complex_schema.realRoot.Builder clearDay() {
day = null;
fieldSetFlags()[2] = false;
return this;
}
/** Gets the value of the 'realRoot' field */
public java.util.List<java.lang.Object> getRealRoot() {
return realRoot;
}
/** Sets the value of the 'realRoot' field */
public avro.complex_schema.realRoot.Builder setRealRoot(java.util.List<java.lang.Object> value) {
validate(fields()[3], value);
this.realRoot = value;
fieldSetFlags()[3] = true;
return this;
}
/** Checks whether the 'realRoot' field has been set */
public boolean hasRealRoot() {
return fieldSetFlags()[3];
}
/** Clears the value of the 'realRoot' field */
public avro.complex_schema.realRoot.Builder clearRealRoot() {
realRoot = null;
fieldSetFlags()[3] = false;
return this;
}
@Override
public realRoot build() {
try {
realRoot record = new realRoot();
record.month = fieldSetFlags()[0] ? this.month : (java.lang.CharSequence) defaultValue(fields()[0]);
record.year = fieldSetFlags()[1] ? this.year : (java.lang.CharSequence) defaultValue(fields()[1]);
record.day = fieldSetFlags()[2] ? this.day : (java.lang.CharSequence) defaultValue(fields()[2]);
record.realRoot = fieldSetFlags()[3] ? this.realRoot : (java.util.List<java.lang.Object>) defaultValue(fields()[3]);
return record;
} catch (Exception e) {
throw new org.apache.avro.AvroRuntimeException(e);
}
}
}
}