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