org.gel.models.report.avro.Ontology Maven / Gradle / Ivy
/**
* Autogenerated by Avro
*
* DO NOT EDIT DIRECTLY
*/
package org.gel.models.report.avro;
@SuppressWarnings("all")
/** The ontology to which a standard term belongs */
@org.apache.avro.specific.AvroGenerated
public class Ontology 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\":\"Ontology\",\"namespace\":\"org.gel.models.report.avro\",\"doc\":\"The ontology to which a standard term belongs\",\"fields\":[{\"name\":\"name\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"version\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}}]}");
public static org.apache.avro.Schema getClassSchema() { return SCHEMA$; }
private java.lang.String name;
private java.lang.String version;
/**
* Default constructor. Note that this does not initialize fields
* to their default values from the schema. If that is desired then
* one should use newBuilder()
.
*/
public Ontology() {}
/**
* All-args constructor.
*/
public Ontology(java.lang.String name, java.lang.String version) {
this.name = name;
this.version = version;
}
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 name;
case 1: return version;
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: name = (java.lang.String)value$; break;
case 1: version = (java.lang.String)value$; break;
default: throw new org.apache.avro.AvroRuntimeException("Bad index");
}
}
/**
* Gets the value of the 'name' field.
*/
public java.lang.String getName() {
return name;
}
/**
* Sets the value of the 'name' field.
* @param value the value to set.
*/
public void setName(java.lang.String value) {
this.name = value;
}
/**
* Gets the value of the 'version' field.
*/
public java.lang.String getVersion() {
return version;
}
/**
* Sets the value of the 'version' field.
* @param value the value to set.
*/
public void setVersion(java.lang.String value) {
this.version = value;
}
/** Creates a new Ontology RecordBuilder */
public static org.gel.models.report.avro.Ontology.Builder newBuilder() {
return new org.gel.models.report.avro.Ontology.Builder();
}
/** Creates a new Ontology RecordBuilder by copying an existing Builder */
public static org.gel.models.report.avro.Ontology.Builder newBuilder(org.gel.models.report.avro.Ontology.Builder other) {
return new org.gel.models.report.avro.Ontology.Builder(other);
}
/** Creates a new Ontology RecordBuilder by copying an existing Ontology instance */
public static org.gel.models.report.avro.Ontology.Builder newBuilder(org.gel.models.report.avro.Ontology other) {
return new org.gel.models.report.avro.Ontology.Builder(other);
}
/**
* RecordBuilder for Ontology instances.
*/
public static class Builder extends org.apache.avro.specific.SpecificRecordBuilderBase
implements org.apache.avro.data.RecordBuilder {
private java.lang.String name;
private java.lang.String version;
/** Creates a new Builder */
private Builder() {
super(org.gel.models.report.avro.Ontology.SCHEMA$);
}
/** Creates a Builder by copying an existing Builder */
private Builder(org.gel.models.report.avro.Ontology.Builder other) {
super(other);
if (isValidValue(fields()[0], other.name)) {
this.name = data().deepCopy(fields()[0].schema(), other.name);
fieldSetFlags()[0] = true;
}
if (isValidValue(fields()[1], other.version)) {
this.version = data().deepCopy(fields()[1].schema(), other.version);
fieldSetFlags()[1] = true;
}
}
/** Creates a Builder by copying an existing Ontology instance */
private Builder(org.gel.models.report.avro.Ontology other) {
super(org.gel.models.report.avro.Ontology.SCHEMA$);
if (isValidValue(fields()[0], other.name)) {
this.name = data().deepCopy(fields()[0].schema(), other.name);
fieldSetFlags()[0] = true;
}
if (isValidValue(fields()[1], other.version)) {
this.version = data().deepCopy(fields()[1].schema(), other.version);
fieldSetFlags()[1] = true;
}
}
/** Gets the value of the 'name' field */
public java.lang.String getName() {
return name;
}
/** Sets the value of the 'name' field */
public org.gel.models.report.avro.Ontology.Builder setName(java.lang.String value) {
validate(fields()[0], value);
this.name = value;
fieldSetFlags()[0] = true;
return this;
}
/** Checks whether the 'name' field has been set */
public boolean hasName() {
return fieldSetFlags()[0];
}
/** Clears the value of the 'name' field */
public org.gel.models.report.avro.Ontology.Builder clearName() {
name = null;
fieldSetFlags()[0] = false;
return this;
}
/** Gets the value of the 'version' field */
public java.lang.String getVersion() {
return version;
}
/** Sets the value of the 'version' field */
public org.gel.models.report.avro.Ontology.Builder setVersion(java.lang.String value) {
validate(fields()[1], value);
this.version = value;
fieldSetFlags()[1] = true;
return this;
}
/** Checks whether the 'version' field has been set */
public boolean hasVersion() {
return fieldSetFlags()[1];
}
/** Clears the value of the 'version' field */
public org.gel.models.report.avro.Ontology.Builder clearVersion() {
version = null;
fieldSetFlags()[1] = false;
return this;
}
@Override
public Ontology build() {
try {
Ontology record = new Ontology();
record.name = fieldSetFlags()[0] ? this.name : (java.lang.String) defaultValue(fields()[0]);
record.version = fieldSetFlags()[1] ? this.version : (java.lang.String) defaultValue(fields()[1]);
return record;
} catch (Exception e) {
throw new org.apache.avro.AvroRuntimeException(e);
}
}
}
}