org.opencb.biodata.models.variant.avro.PharmacogenomicsAlleles 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 PharmacogenomicsAlleles 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\":\"PharmacogenomicsAlleles\",\"namespace\":\"org.opencb.biodata.models.variant.avro\",\"fields\":[{\"name\":\"allele\",\"type\":[\"null\",{\"type\":\"string\",\"avro.java.string\":\"String\"}]},{\"name\":\"annotation\",\"type\":[\"null\",{\"type\":\"string\",\"avro.java.string\":\"String\"}]},{\"name\":\"description\",\"type\":[\"null\",{\"type\":\"string\",\"avro.java.string\":\"String\"}]}]}");
public static org.apache.avro.Schema getClassSchema() { return SCHEMA$; }
private java.lang.String allele;
private java.lang.String annotation;
private java.lang.String description;
/**
* 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 PharmacogenomicsAlleles() {}
/**
* All-args constructor.
*/
public PharmacogenomicsAlleles(java.lang.String allele, java.lang.String annotation, java.lang.String description) {
this.allele = allele;
this.annotation = annotation;
this.description = description;
}
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 allele;
case 1: return annotation;
case 2: return description;
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: allele = (java.lang.String)value$; break;
case 1: annotation = (java.lang.String)value$; break;
case 2: description = (java.lang.String)value$; break;
default: throw new org.apache.avro.AvroRuntimeException("Bad index");
}
}
/**
* Gets the value of the 'allele' field.
*/
public java.lang.String getAllele() {
return allele;
}
/**
* Sets the value of the 'allele' field.
* @param value the value to set.
*/
public void setAllele(java.lang.String value) {
this.allele = value;
}
/**
* Gets the value of the 'annotation' field.
*/
public java.lang.String getAnnotation() {
return annotation;
}
/**
* Sets the value of the 'annotation' field.
* @param value the value to set.
*/
public void setAnnotation(java.lang.String value) {
this.annotation = value;
}
/**
* Gets the value of the 'description' field.
*/
public java.lang.String getDescription() {
return description;
}
/**
* Sets the value of the 'description' field.
* @param value the value to set.
*/
public void setDescription(java.lang.String value) {
this.description = value;
}
/** Creates a new PharmacogenomicsAlleles RecordBuilder */
public static org.opencb.biodata.models.variant.avro.PharmacogenomicsAlleles.Builder newBuilder() {
return new org.opencb.biodata.models.variant.avro.PharmacogenomicsAlleles.Builder();
}
/** Creates a new PharmacogenomicsAlleles RecordBuilder by copying an existing Builder */
public static org.opencb.biodata.models.variant.avro.PharmacogenomicsAlleles.Builder newBuilder(org.opencb.biodata.models.variant.avro.PharmacogenomicsAlleles.Builder other) {
return new org.opencb.biodata.models.variant.avro.PharmacogenomicsAlleles.Builder(other);
}
/** Creates a new PharmacogenomicsAlleles RecordBuilder by copying an existing PharmacogenomicsAlleles instance */
public static org.opencb.biodata.models.variant.avro.PharmacogenomicsAlleles.Builder newBuilder(org.opencb.biodata.models.variant.avro.PharmacogenomicsAlleles other) {
return new org.opencb.biodata.models.variant.avro.PharmacogenomicsAlleles.Builder(other);
}
/**
* RecordBuilder for PharmacogenomicsAlleles instances.
*/
public static class Builder extends org.apache.avro.specific.SpecificRecordBuilderBase
implements org.apache.avro.data.RecordBuilder {
private java.lang.String allele;
private java.lang.String annotation;
private java.lang.String description;
/** Creates a new Builder */
private Builder() {
super(org.opencb.biodata.models.variant.avro.PharmacogenomicsAlleles.SCHEMA$);
}
/** Creates a Builder by copying an existing Builder */
private Builder(org.opencb.biodata.models.variant.avro.PharmacogenomicsAlleles.Builder other) {
super(other);
if (isValidValue(fields()[0], other.allele)) {
this.allele = data().deepCopy(fields()[0].schema(), other.allele);
fieldSetFlags()[0] = true;
}
if (isValidValue(fields()[1], other.annotation)) {
this.annotation = data().deepCopy(fields()[1].schema(), other.annotation);
fieldSetFlags()[1] = true;
}
if (isValidValue(fields()[2], other.description)) {
this.description = data().deepCopy(fields()[2].schema(), other.description);
fieldSetFlags()[2] = true;
}
}
/** Creates a Builder by copying an existing PharmacogenomicsAlleles instance */
private Builder(org.opencb.biodata.models.variant.avro.PharmacogenomicsAlleles other) {
super(org.opencb.biodata.models.variant.avro.PharmacogenomicsAlleles.SCHEMA$);
if (isValidValue(fields()[0], other.allele)) {
this.allele = data().deepCopy(fields()[0].schema(), other.allele);
fieldSetFlags()[0] = true;
}
if (isValidValue(fields()[1], other.annotation)) {
this.annotation = data().deepCopy(fields()[1].schema(), other.annotation);
fieldSetFlags()[1] = true;
}
if (isValidValue(fields()[2], other.description)) {
this.description = data().deepCopy(fields()[2].schema(), other.description);
fieldSetFlags()[2] = true;
}
}
/** Gets the value of the 'allele' field */
public java.lang.String getAllele() {
return allele;
}
/** Sets the value of the 'allele' field */
public org.opencb.biodata.models.variant.avro.PharmacogenomicsAlleles.Builder setAllele(java.lang.String value) {
validate(fields()[0], value);
this.allele = value;
fieldSetFlags()[0] = true;
return this;
}
/** Checks whether the 'allele' field has been set */
public boolean hasAllele() {
return fieldSetFlags()[0];
}
/** Clears the value of the 'allele' field */
public org.opencb.biodata.models.variant.avro.PharmacogenomicsAlleles.Builder clearAllele() {
allele = null;
fieldSetFlags()[0] = false;
return this;
}
/** Gets the value of the 'annotation' field */
public java.lang.String getAnnotation() {
return annotation;
}
/** Sets the value of the 'annotation' field */
public org.opencb.biodata.models.variant.avro.PharmacogenomicsAlleles.Builder setAnnotation(java.lang.String value) {
validate(fields()[1], value);
this.annotation = value;
fieldSetFlags()[1] = true;
return this;
}
/** Checks whether the 'annotation' field has been set */
public boolean hasAnnotation() {
return fieldSetFlags()[1];
}
/** Clears the value of the 'annotation' field */
public org.opencb.biodata.models.variant.avro.PharmacogenomicsAlleles.Builder clearAnnotation() {
annotation = null;
fieldSetFlags()[1] = false;
return this;
}
/** Gets the value of the 'description' field */
public java.lang.String getDescription() {
return description;
}
/** Sets the value of the 'description' field */
public org.opencb.biodata.models.variant.avro.PharmacogenomicsAlleles.Builder setDescription(java.lang.String value) {
validate(fields()[2], value);
this.description = value;
fieldSetFlags()[2] = true;
return this;
}
/** Checks whether the 'description' field has been set */
public boolean hasDescription() {
return fieldSetFlags()[2];
}
/** Clears the value of the 'description' field */
public org.opencb.biodata.models.variant.avro.PharmacogenomicsAlleles.Builder clearDescription() {
description = null;
fieldSetFlags()[2] = false;
return this;
}
@Override
public PharmacogenomicsAlleles build() {
try {
PharmacogenomicsAlleles record = new PharmacogenomicsAlleles();
record.allele = fieldSetFlags()[0] ? this.allele : (java.lang.String) defaultValue(fields()[0]);
record.annotation = fieldSetFlags()[1] ? this.annotation : (java.lang.String) defaultValue(fields()[1]);
record.description = fieldSetFlags()[2] ? this.description : (java.lang.String) defaultValue(fields()[2]);
return record;
} catch (Exception e) {
throw new org.apache.avro.AvroRuntimeException(e);
}
}
}
}