org.opencb.biodata.models.variant.avro.SequenceOntologyTerm Maven / Gradle / Ivy
The newest version!
/**
* Autogenerated by Avro
*
* DO NOT EDIT DIRECTLY
*/
package org.opencb.biodata.models.variant.avro;
@SuppressWarnings("all")
@org.apache.avro.specific.AvroGenerated
public class SequenceOntologyTerm 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\":\"SequenceOntologyTerm\",\"namespace\":\"org.opencb.biodata.models.variant.avro\",\"fields\":[{\"name\":\"accession\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"name\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}}]}");
public static org.apache.avro.Schema getClassSchema() { return SCHEMA$; }
private java.lang.String accession;
private java.lang.String name;
/**
* 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 SequenceOntologyTerm() {}
/**
* All-args constructor.
*/
public SequenceOntologyTerm(java.lang.String accession, java.lang.String name) {
this.accession = accession;
this.name = name;
}
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 accession;
case 1: return name;
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: accession = (java.lang.String)value$; break;
case 1: name = (java.lang.String)value$; break;
default: throw new org.apache.avro.AvroRuntimeException("Bad index");
}
}
/**
* Gets the value of the 'accession' field.
*/
public java.lang.String getAccession() {
return accession;
}
/**
* Sets the value of the 'accession' field.
* @param value the value to set.
*/
public void setAccession(java.lang.String value) {
this.accession = value;
}
/**
* 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;
}
/** Creates a new SequenceOntologyTerm RecordBuilder */
public static org.opencb.biodata.models.variant.avro.SequenceOntologyTerm.Builder newBuilder() {
return new org.opencb.biodata.models.variant.avro.SequenceOntologyTerm.Builder();
}
/** Creates a new SequenceOntologyTerm RecordBuilder by copying an existing Builder */
public static org.opencb.biodata.models.variant.avro.SequenceOntologyTerm.Builder newBuilder(org.opencb.biodata.models.variant.avro.SequenceOntologyTerm.Builder other) {
return new org.opencb.biodata.models.variant.avro.SequenceOntologyTerm.Builder(other);
}
/** Creates a new SequenceOntologyTerm RecordBuilder by copying an existing SequenceOntologyTerm instance */
public static org.opencb.biodata.models.variant.avro.SequenceOntologyTerm.Builder newBuilder(org.opencb.biodata.models.variant.avro.SequenceOntologyTerm other) {
return new org.opencb.biodata.models.variant.avro.SequenceOntologyTerm.Builder(other);
}
/**
* RecordBuilder for SequenceOntologyTerm instances.
*/
public static class Builder extends org.apache.avro.specific.SpecificRecordBuilderBase
implements org.apache.avro.data.RecordBuilder {
private java.lang.String accession;
private java.lang.String name;
/** Creates a new Builder */
private Builder() {
super(org.opencb.biodata.models.variant.avro.SequenceOntologyTerm.SCHEMA$);
}
/** Creates a Builder by copying an existing Builder */
private Builder(org.opencb.biodata.models.variant.avro.SequenceOntologyTerm.Builder other) {
super(other);
if (isValidValue(fields()[0], other.accession)) {
this.accession = data().deepCopy(fields()[0].schema(), other.accession);
fieldSetFlags()[0] = true;
}
if (isValidValue(fields()[1], other.name)) {
this.name = data().deepCopy(fields()[1].schema(), other.name);
fieldSetFlags()[1] = true;
}
}
/** Creates a Builder by copying an existing SequenceOntologyTerm instance */
private Builder(org.opencb.biodata.models.variant.avro.SequenceOntologyTerm other) {
super(org.opencb.biodata.models.variant.avro.SequenceOntologyTerm.SCHEMA$);
if (isValidValue(fields()[0], other.accession)) {
this.accession = data().deepCopy(fields()[0].schema(), other.accession);
fieldSetFlags()[0] = true;
}
if (isValidValue(fields()[1], other.name)) {
this.name = data().deepCopy(fields()[1].schema(), other.name);
fieldSetFlags()[1] = true;
}
}
/** Gets the value of the 'accession' field */
public java.lang.String getAccession() {
return accession;
}
/** Sets the value of the 'accession' field */
public org.opencb.biodata.models.variant.avro.SequenceOntologyTerm.Builder setAccession(java.lang.String value) {
validate(fields()[0], value);
this.accession = value;
fieldSetFlags()[0] = true;
return this;
}
/** Checks whether the 'accession' field has been set */
public boolean hasAccession() {
return fieldSetFlags()[0];
}
/** Clears the value of the 'accession' field */
public org.opencb.biodata.models.variant.avro.SequenceOntologyTerm.Builder clearAccession() {
accession = null;
fieldSetFlags()[0] = false;
return this;
}
/** Gets the value of the 'name' field */
public java.lang.String getName() {
return name;
}
/** Sets the value of the 'name' field */
public org.opencb.biodata.models.variant.avro.SequenceOntologyTerm.Builder setName(java.lang.String value) {
validate(fields()[1], value);
this.name = value;
fieldSetFlags()[1] = true;
return this;
}
/** Checks whether the 'name' field has been set */
public boolean hasName() {
return fieldSetFlags()[1];
}
/** Clears the value of the 'name' field */
public org.opencb.biodata.models.variant.avro.SequenceOntologyTerm.Builder clearName() {
name = null;
fieldSetFlags()[1] = false;
return this;
}
@Override
public SequenceOntologyTerm build() {
try {
SequenceOntologyTerm record = new SequenceOntologyTerm();
record.accession = fieldSetFlags()[0] ? this.accession : (java.lang.String) defaultValue(fields()[0]);
record.name = fieldSetFlags()[1] ? this.name : (java.lang.String) defaultValue(fields()[1]);
return record;
} catch (Exception e) {
throw new org.apache.avro.AvroRuntimeException(e);
}
}
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy