org.opencb.biodata.models.variant.avro.Pharmacogenomics 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 Pharmacogenomics 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\":\"Pharmacogenomics\",\"namespace\":\"org.opencb.biodata.models.variant.avro\",\"fields\":[{\"name\":\"id\",\"type\":[\"null\",{\"type\":\"string\",\"avro.java.string\":\"String\"}]},{\"name\":\"name\",\"type\":[\"null\",{\"type\":\"string\",\"avro.java.string\":\"String\"}]},{\"name\":\"source\",\"type\":[\"null\",{\"type\":\"string\",\"avro.java.string\":\"String\"}]},{\"name\":\"types\",\"type\":[\"null\",{\"type\":\"array\",\"items\":{\"type\":\"string\",\"avro.java.string\":\"String\"}}]},{\"name\":\"smiles\",\"type\":[\"null\",{\"type\":\"string\",\"avro.java.string\":\"String\"}]},{\"name\":\"inChI\",\"type\":[\"null\",{\"type\":\"string\",\"avro.java.string\":\"String\"}]},{\"name\":\"annotations\",\"type\":[\"null\",{\"type\":\"array\",\"items\":{\"type\":\"record\",\"name\":\"PharmacogenomicsClinicalAnnotation\",\"fields\":[{\"name\":\"variantId\",\"type\":[\"null\",{\"type\":\"string\",\"avro.java.string\":\"String\"}]},{\"name\":\"geneNames\",\"type\":[\"null\",{\"type\":\"array\",\"items\":{\"type\":\"string\",\"avro.java.string\":\"String\"}}]},{\"name\":\"phenotypes\",\"type\":[\"null\",{\"type\":\"array\",\"items\":{\"type\":\"string\",\"avro.java.string\":\"String\"}}]},{\"name\":\"phenotypeTypes\",\"type\":[\"null\",{\"type\":\"array\",\"items\":{\"type\":\"string\",\"avro.java.string\":\"String\"}}]},{\"name\":\"confidence\",\"type\":[\"null\",{\"type\":\"string\",\"avro.java.string\":\"String\"}]},{\"name\":\"score\",\"type\":[\"null\",{\"type\":\"string\",\"avro.java.string\":\"String\"}]},{\"name\":\"url\",\"type\":[\"null\",{\"type\":\"string\",\"avro.java.string\":\"String\"}]},{\"name\":\"summary\",\"type\":[\"null\",{\"type\":\"string\",\"avro.java.string\":\"String\"}]},{\"name\":\"pubmed\",\"type\":[\"null\",{\"type\":\"array\",\"items\":{\"type\":\"string\",\"avro.java.string\":\"String\"}}]},{\"name\":\"alleles\",\"type\":[\"null\",{\"type\":\"array\",\"items\":{\"type\":\"record\",\"name\":\"PharmacogenomicsAlleles\",\"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 id;
private java.lang.String name;
private java.lang.String source;
private java.util.List types;
private java.lang.String smiles;
private java.lang.String inChI;
private java.util.List annotations;
/**
* 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 Pharmacogenomics() {}
/**
* All-args constructor.
*/
public Pharmacogenomics(java.lang.String id, java.lang.String name, java.lang.String source, java.util.List types, java.lang.String smiles, java.lang.String inChI, java.util.List annotations) {
this.id = id;
this.name = name;
this.source = source;
this.types = types;
this.smiles = smiles;
this.inChI = inChI;
this.annotations = annotations;
}
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 id;
case 1: return name;
case 2: return source;
case 3: return types;
case 4: return smiles;
case 5: return inChI;
case 6: return annotations;
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: id = (java.lang.String)value$; break;
case 1: name = (java.lang.String)value$; break;
case 2: source = (java.lang.String)value$; break;
case 3: types = (java.util.List)value$; break;
case 4: smiles = (java.lang.String)value$; break;
case 5: inChI = (java.lang.String)value$; break;
case 6: annotations = (java.util.List)value$; break;
default: throw new org.apache.avro.AvroRuntimeException("Bad index");
}
}
/**
* Gets the value of the 'id' field.
*/
public java.lang.String getId() {
return id;
}
/**
* Sets the value of the 'id' field.
* @param value the value to set.
*/
public void setId(java.lang.String value) {
this.id = 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;
}
/**
* Gets the value of the 'source' field.
*/
public java.lang.String getSource() {
return source;
}
/**
* Sets the value of the 'source' field.
* @param value the value to set.
*/
public void setSource(java.lang.String value) {
this.source = value;
}
/**
* Gets the value of the 'types' field.
*/
public java.util.List getTypes() {
return types;
}
/**
* Sets the value of the 'types' field.
* @param value the value to set.
*/
public void setTypes(java.util.List value) {
this.types = value;
}
/**
* Gets the value of the 'smiles' field.
*/
public java.lang.String getSmiles() {
return smiles;
}
/**
* Sets the value of the 'smiles' field.
* @param value the value to set.
*/
public void setSmiles(java.lang.String value) {
this.smiles = value;
}
/**
* Gets the value of the 'inChI' field.
*/
public java.lang.String getInChI() {
return inChI;
}
/**
* Sets the value of the 'inChI' field.
* @param value the value to set.
*/
public void setInChI(java.lang.String value) {
this.inChI = value;
}
/**
* Gets the value of the 'annotations' field.
*/
public java.util.List getAnnotations() {
return annotations;
}
/**
* Sets the value of the 'annotations' field.
* @param value the value to set.
*/
public void setAnnotations(java.util.List value) {
this.annotations = value;
}
/** Creates a new Pharmacogenomics RecordBuilder */
public static org.opencb.biodata.models.variant.avro.Pharmacogenomics.Builder newBuilder() {
return new org.opencb.biodata.models.variant.avro.Pharmacogenomics.Builder();
}
/** Creates a new Pharmacogenomics RecordBuilder by copying an existing Builder */
public static org.opencb.biodata.models.variant.avro.Pharmacogenomics.Builder newBuilder(org.opencb.biodata.models.variant.avro.Pharmacogenomics.Builder other) {
return new org.opencb.biodata.models.variant.avro.Pharmacogenomics.Builder(other);
}
/** Creates a new Pharmacogenomics RecordBuilder by copying an existing Pharmacogenomics instance */
public static org.opencb.biodata.models.variant.avro.Pharmacogenomics.Builder newBuilder(org.opencb.biodata.models.variant.avro.Pharmacogenomics other) {
return new org.opencb.biodata.models.variant.avro.Pharmacogenomics.Builder(other);
}
/**
* RecordBuilder for Pharmacogenomics instances.
*/
public static class Builder extends org.apache.avro.specific.SpecificRecordBuilderBase
implements org.apache.avro.data.RecordBuilder {
private java.lang.String id;
private java.lang.String name;
private java.lang.String source;
private java.util.List types;
private java.lang.String smiles;
private java.lang.String inChI;
private java.util.List annotations;
/** Creates a new Builder */
private Builder() {
super(org.opencb.biodata.models.variant.avro.Pharmacogenomics.SCHEMA$);
}
/** Creates a Builder by copying an existing Builder */
private Builder(org.opencb.biodata.models.variant.avro.Pharmacogenomics.Builder other) {
super(other);
if (isValidValue(fields()[0], other.id)) {
this.id = data().deepCopy(fields()[0].schema(), other.id);
fieldSetFlags()[0] = true;
}
if (isValidValue(fields()[1], other.name)) {
this.name = data().deepCopy(fields()[1].schema(), other.name);
fieldSetFlags()[1] = true;
}
if (isValidValue(fields()[2], other.source)) {
this.source = data().deepCopy(fields()[2].schema(), other.source);
fieldSetFlags()[2] = true;
}
if (isValidValue(fields()[3], other.types)) {
this.types = data().deepCopy(fields()[3].schema(), other.types);
fieldSetFlags()[3] = true;
}
if (isValidValue(fields()[4], other.smiles)) {
this.smiles = data().deepCopy(fields()[4].schema(), other.smiles);
fieldSetFlags()[4] = true;
}
if (isValidValue(fields()[5], other.inChI)) {
this.inChI = data().deepCopy(fields()[5].schema(), other.inChI);
fieldSetFlags()[5] = true;
}
if (isValidValue(fields()[6], other.annotations)) {
this.annotations = data().deepCopy(fields()[6].schema(), other.annotations);
fieldSetFlags()[6] = true;
}
}
/** Creates a Builder by copying an existing Pharmacogenomics instance */
private Builder(org.opencb.biodata.models.variant.avro.Pharmacogenomics other) {
super(org.opencb.biodata.models.variant.avro.Pharmacogenomics.SCHEMA$);
if (isValidValue(fields()[0], other.id)) {
this.id = data().deepCopy(fields()[0].schema(), other.id);
fieldSetFlags()[0] = true;
}
if (isValidValue(fields()[1], other.name)) {
this.name = data().deepCopy(fields()[1].schema(), other.name);
fieldSetFlags()[1] = true;
}
if (isValidValue(fields()[2], other.source)) {
this.source = data().deepCopy(fields()[2].schema(), other.source);
fieldSetFlags()[2] = true;
}
if (isValidValue(fields()[3], other.types)) {
this.types = data().deepCopy(fields()[3].schema(), other.types);
fieldSetFlags()[3] = true;
}
if (isValidValue(fields()[4], other.smiles)) {
this.smiles = data().deepCopy(fields()[4].schema(), other.smiles);
fieldSetFlags()[4] = true;
}
if (isValidValue(fields()[5], other.inChI)) {
this.inChI = data().deepCopy(fields()[5].schema(), other.inChI);
fieldSetFlags()[5] = true;
}
if (isValidValue(fields()[6], other.annotations)) {
this.annotations = data().deepCopy(fields()[6].schema(), other.annotations);
fieldSetFlags()[6] = true;
}
}
/** Gets the value of the 'id' field */
public java.lang.String getId() {
return id;
}
/** Sets the value of the 'id' field */
public org.opencb.biodata.models.variant.avro.Pharmacogenomics.Builder setId(java.lang.String value) {
validate(fields()[0], value);
this.id = value;
fieldSetFlags()[0] = true;
return this;
}
/** Checks whether the 'id' field has been set */
public boolean hasId() {
return fieldSetFlags()[0];
}
/** Clears the value of the 'id' field */
public org.opencb.biodata.models.variant.avro.Pharmacogenomics.Builder clearId() {
id = 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.Pharmacogenomics.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.Pharmacogenomics.Builder clearName() {
name = null;
fieldSetFlags()[1] = false;
return this;
}
/** Gets the value of the 'source' field */
public java.lang.String getSource() {
return source;
}
/** Sets the value of the 'source' field */
public org.opencb.biodata.models.variant.avro.Pharmacogenomics.Builder setSource(java.lang.String value) {
validate(fields()[2], value);
this.source = value;
fieldSetFlags()[2] = true;
return this;
}
/** Checks whether the 'source' field has been set */
public boolean hasSource() {
return fieldSetFlags()[2];
}
/** Clears the value of the 'source' field */
public org.opencb.biodata.models.variant.avro.Pharmacogenomics.Builder clearSource() {
source = null;
fieldSetFlags()[2] = false;
return this;
}
/** Gets the value of the 'types' field */
public java.util.List getTypes() {
return types;
}
/** Sets the value of the 'types' field */
public org.opencb.biodata.models.variant.avro.Pharmacogenomics.Builder setTypes(java.util.List value) {
validate(fields()[3], value);
this.types = value;
fieldSetFlags()[3] = true;
return this;
}
/** Checks whether the 'types' field has been set */
public boolean hasTypes() {
return fieldSetFlags()[3];
}
/** Clears the value of the 'types' field */
public org.opencb.biodata.models.variant.avro.Pharmacogenomics.Builder clearTypes() {
types = null;
fieldSetFlags()[3] = false;
return this;
}
/** Gets the value of the 'smiles' field */
public java.lang.String getSmiles() {
return smiles;
}
/** Sets the value of the 'smiles' field */
public org.opencb.biodata.models.variant.avro.Pharmacogenomics.Builder setSmiles(java.lang.String value) {
validate(fields()[4], value);
this.smiles = value;
fieldSetFlags()[4] = true;
return this;
}
/** Checks whether the 'smiles' field has been set */
public boolean hasSmiles() {
return fieldSetFlags()[4];
}
/** Clears the value of the 'smiles' field */
public org.opencb.biodata.models.variant.avro.Pharmacogenomics.Builder clearSmiles() {
smiles = null;
fieldSetFlags()[4] = false;
return this;
}
/** Gets the value of the 'inChI' field */
public java.lang.String getInChI() {
return inChI;
}
/** Sets the value of the 'inChI' field */
public org.opencb.biodata.models.variant.avro.Pharmacogenomics.Builder setInChI(java.lang.String value) {
validate(fields()[5], value);
this.inChI = value;
fieldSetFlags()[5] = true;
return this;
}
/** Checks whether the 'inChI' field has been set */
public boolean hasInChI() {
return fieldSetFlags()[5];
}
/** Clears the value of the 'inChI' field */
public org.opencb.biodata.models.variant.avro.Pharmacogenomics.Builder clearInChI() {
inChI = null;
fieldSetFlags()[5] = false;
return this;
}
/** Gets the value of the 'annotations' field */
public java.util.List getAnnotations() {
return annotations;
}
/** Sets the value of the 'annotations' field */
public org.opencb.biodata.models.variant.avro.Pharmacogenomics.Builder setAnnotations(java.util.List value) {
validate(fields()[6], value);
this.annotations = value;
fieldSetFlags()[6] = true;
return this;
}
/** Checks whether the 'annotations' field has been set */
public boolean hasAnnotations() {
return fieldSetFlags()[6];
}
/** Clears the value of the 'annotations' field */
public org.opencb.biodata.models.variant.avro.Pharmacogenomics.Builder clearAnnotations() {
annotations = null;
fieldSetFlags()[6] = false;
return this;
}
@Override
public Pharmacogenomics build() {
try {
Pharmacogenomics record = new Pharmacogenomics();
record.id = fieldSetFlags()[0] ? this.id : (java.lang.String) defaultValue(fields()[0]);
record.name = fieldSetFlags()[1] ? this.name : (java.lang.String) defaultValue(fields()[1]);
record.source = fieldSetFlags()[2] ? this.source : (java.lang.String) defaultValue(fields()[2]);
record.types = fieldSetFlags()[3] ? this.types : (java.util.List) defaultValue(fields()[3]);
record.smiles = fieldSetFlags()[4] ? this.smiles : (java.lang.String) defaultValue(fields()[4]);
record.inChI = fieldSetFlags()[5] ? this.inChI : (java.lang.String) defaultValue(fields()[5]);
record.annotations = fieldSetFlags()[6] ? this.annotations : (java.util.List) defaultValue(fields()[6]);
return record;
} catch (Exception e) {
throw new org.apache.avro.AvroRuntimeException(e);
}
}
}
}