/** * Autogenerated by Avro * * DO NOT EDIT DIRECTLY */ package org.w3.www._2001.xmlschema; @SuppressWarnings("all") /** Qualified Name */ @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\":\"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.\"}]}"); public static org.apache.avro.Schema getClassSchema() { return SCHEMA$; } /** The namespace of this qualified name. */ @Deprecated public java.lang.CharSequence namespace; /** The local part of this qualified name. */ @Deprecated public java.lang.CharSequence localPart; /** * 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(java.lang.CharSequence namespace, java.lang.CharSequence localPart) { this.namespace = namespace; this.localPart = localPart; } 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 namespace; case 1: return localPart; 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: namespace = (java.lang.CharSequence)value$; break; case 1: localPart = (java.lang.CharSequence)value$; break; default: throw new org.apache.avro.AvroRuntimeException("Bad index"); } } /** * Gets the value of the 'namespace' field. * The namespace of this qualified name. */ public java.lang.CharSequence getNamespace() { return namespace; } /** * Sets the value of the 'namespace' field. * The namespace of this qualified name. * @param value the value to set. */ public void setNamespace(java.lang.CharSequence value) { this.namespace = value; } /** * Gets the value of the 'localPart' field. * The local part of this qualified name. */ public java.lang.CharSequence getLocalPart() { return localPart; } /** * Sets the value of the 'localPart' field. * The local part of this qualified name. * @param value the value to set. */ public void setLocalPart(java.lang.CharSequence value) { this.localPart = value; } /** Creates a new qName RecordBuilder */ public static org.w3.www._2001.xmlschema.qName.Builder newBuilder() { return new org.w3.www._2001.xmlschema.qName.Builder(); } /** Creates a new qName RecordBuilder by copying an existing Builder */ public static org.w3.www._2001.xmlschema.qName.Builder newBuilder(org.w3.www._2001.xmlschema.qName.Builder other) { return new org.w3.www._2001.xmlschema.qName.Builder(other); } /** Creates a new qName RecordBuilder by copying an existing qName instance */ public static org.w3.www._2001.xmlschema.qName.Builder newBuilder(org.w3.www._2001.xmlschema.qName other) { return new org.w3.www._2001.xmlschema.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 java.lang.CharSequence namespace; private java.lang.CharSequence localPart; /** Creates a new Builder */ private Builder() { super(org.w3.www._2001.xmlschema.qName.SCHEMA$); } /** Creates a Builder by copying an existing Builder */ private Builder(org.w3.www._2001.xmlschema.qName.Builder other) { super(other); if (isValidValue(fields()[0], other.namespace)) { this.namespace = data().deepCopy(fields()[0].schema(), other.namespace); fieldSetFlags()[0] = true; } if (isValidValue(fields()[1], other.localPart)) { this.localPart = data().deepCopy(fields()[1].schema(), other.localPart); fieldSetFlags()[1] = true; } } /** Creates a Builder by copying an existing qName instance */ private Builder(org.w3.www._2001.xmlschema.qName other) { super(org.w3.www._2001.xmlschema.qName.SCHEMA$); if (isValidValue(fields()[0], other.namespace)) { this.namespace = data().deepCopy(fields()[0].schema(), other.namespace); fieldSetFlags()[0] = true; } if (isValidValue(fields()[1], other.localPart)) { this.localPart = data().deepCopy(fields()[1].schema(), other.localPart); fieldSetFlags()[1] = true; } } /** Gets the value of the 'namespace' field */ public java.lang.CharSequence getNamespace() { return namespace; } /** Sets the value of the 'namespace' field */ public org.w3.www._2001.xmlschema.qName.Builder setNamespace(java.lang.CharSequence value) { validate(fields()[0], value); this.namespace = value; fieldSetFlags()[0] = true; return this; } /** Checks whether the 'namespace' field has been set */ public boolean hasNamespace() { return fieldSetFlags()[0]; } /** Clears the value of the 'namespace' field */ public org.w3.www._2001.xmlschema.qName.Builder clearNamespace() { namespace = null; fieldSetFlags()[0] = false; return this; } /** Gets the value of the 'localPart' field */ public java.lang.CharSequence getLocalPart() { return localPart; } /** Sets the value of the 'localPart' field */ public org.w3.www._2001.xmlschema.qName.Builder setLocalPart(java.lang.CharSequence value) { validate(fields()[1], value); this.localPart = value; fieldSetFlags()[1] = true; return this; } /** Checks whether the 'localPart' field has been set */ public boolean hasLocalPart() { return fieldSetFlags()[1]; } /** Clears the value of the 'localPart' field */ public org.w3.www._2001.xmlschema.qName.Builder clearLocalPart() { localPart = null; fieldSetFlags()[1] = false; return this; } @Override public qName build() { try { qName record = new qName(); record.namespace = fieldSetFlags()[0] ? this.namespace : (java.lang.CharSequence) defaultValue(fields()[0]); record.localPart = fieldSetFlags()[1] ? this.localPart : (java.lang.CharSequence) defaultValue(fields()[1]); return record; } catch (Exception e) { throw new org.apache.avro.AvroRuntimeException(e); } } } }