org.opencb.biodata.models.variant.avro.Cytoband 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 Cytoband 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\":\"Cytoband\",\"namespace\":\"org.opencb.biodata.models.variant.avro\",\"fields\":[{\"name\":\"chromosome\",\"type\":[\"null\",{\"type\":\"string\",\"avro.java.string\":\"String\"}]},{\"name\":\"stain\",\"type\":[\"null\",{\"type\":\"string\",\"avro.java.string\":\"String\"}]},{\"name\":\"name\",\"type\":[\"null\",{\"type\":\"string\",\"avro.java.string\":\"String\"}]},{\"name\":\"start\",\"type\":[\"null\",\"int\"]},{\"name\":\"end\",\"type\":[\"null\",\"int\"]}]}");
public static org.apache.avro.Schema getClassSchema() { return SCHEMA$; }
private java.lang.String chromosome;
private java.lang.String stain;
private java.lang.String name;
private java.lang.Integer start;
private java.lang.Integer end;
/**
* 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 Cytoband() {}
/**
* All-args constructor.
*/
public Cytoband(java.lang.String chromosome, java.lang.String stain, java.lang.String name, java.lang.Integer start, java.lang.Integer end) {
this.chromosome = chromosome;
this.stain = stain;
this.name = name;
this.start = start;
this.end = end;
}
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 chromosome;
case 1: return stain;
case 2: return name;
case 3: return start;
case 4: return end;
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: chromosome = (java.lang.String)value$; break;
case 1: stain = (java.lang.String)value$; break;
case 2: name = (java.lang.String)value$; break;
case 3: start = (java.lang.Integer)value$; break;
case 4: end = (java.lang.Integer)value$; break;
default: throw new org.apache.avro.AvroRuntimeException("Bad index");
}
}
/**
* Gets the value of the 'chromosome' field.
*/
public java.lang.String getChromosome() {
return chromosome;
}
/**
* Sets the value of the 'chromosome' field.
* @param value the value to set.
*/
public void setChromosome(java.lang.String value) {
this.chromosome = value;
}
/**
* Gets the value of the 'stain' field.
*/
public java.lang.String getStain() {
return stain;
}
/**
* Sets the value of the 'stain' field.
* @param value the value to set.
*/
public void setStain(java.lang.String value) {
this.stain = 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 'start' field.
*/
public java.lang.Integer getStart() {
return start;
}
/**
* Sets the value of the 'start' field.
* @param value the value to set.
*/
public void setStart(java.lang.Integer value) {
this.start = value;
}
/**
* Gets the value of the 'end' field.
*/
public java.lang.Integer getEnd() {
return end;
}
/**
* Sets the value of the 'end' field.
* @param value the value to set.
*/
public void setEnd(java.lang.Integer value) {
this.end = value;
}
/** Creates a new Cytoband RecordBuilder */
public static org.opencb.biodata.models.variant.avro.Cytoband.Builder newBuilder() {
return new org.opencb.biodata.models.variant.avro.Cytoband.Builder();
}
/** Creates a new Cytoband RecordBuilder by copying an existing Builder */
public static org.opencb.biodata.models.variant.avro.Cytoband.Builder newBuilder(org.opencb.biodata.models.variant.avro.Cytoband.Builder other) {
return new org.opencb.biodata.models.variant.avro.Cytoband.Builder(other);
}
/** Creates a new Cytoband RecordBuilder by copying an existing Cytoband instance */
public static org.opencb.biodata.models.variant.avro.Cytoband.Builder newBuilder(org.opencb.biodata.models.variant.avro.Cytoband other) {
return new org.opencb.biodata.models.variant.avro.Cytoband.Builder(other);
}
/**
* RecordBuilder for Cytoband instances.
*/
public static class Builder extends org.apache.avro.specific.SpecificRecordBuilderBase
implements org.apache.avro.data.RecordBuilder {
private java.lang.String chromosome;
private java.lang.String stain;
private java.lang.String name;
private java.lang.Integer start;
private java.lang.Integer end;
/** Creates a new Builder */
private Builder() {
super(org.opencb.biodata.models.variant.avro.Cytoband.SCHEMA$);
}
/** Creates a Builder by copying an existing Builder */
private Builder(org.opencb.biodata.models.variant.avro.Cytoband.Builder other) {
super(other);
if (isValidValue(fields()[0], other.chromosome)) {
this.chromosome = data().deepCopy(fields()[0].schema(), other.chromosome);
fieldSetFlags()[0] = true;
}
if (isValidValue(fields()[1], other.stain)) {
this.stain = data().deepCopy(fields()[1].schema(), other.stain);
fieldSetFlags()[1] = true;
}
if (isValidValue(fields()[2], other.name)) {
this.name = data().deepCopy(fields()[2].schema(), other.name);
fieldSetFlags()[2] = true;
}
if (isValidValue(fields()[3], other.start)) {
this.start = data().deepCopy(fields()[3].schema(), other.start);
fieldSetFlags()[3] = true;
}
if (isValidValue(fields()[4], other.end)) {
this.end = data().deepCopy(fields()[4].schema(), other.end);
fieldSetFlags()[4] = true;
}
}
/** Creates a Builder by copying an existing Cytoband instance */
private Builder(org.opencb.biodata.models.variant.avro.Cytoband other) {
super(org.opencb.biodata.models.variant.avro.Cytoband.SCHEMA$);
if (isValidValue(fields()[0], other.chromosome)) {
this.chromosome = data().deepCopy(fields()[0].schema(), other.chromosome);
fieldSetFlags()[0] = true;
}
if (isValidValue(fields()[1], other.stain)) {
this.stain = data().deepCopy(fields()[1].schema(), other.stain);
fieldSetFlags()[1] = true;
}
if (isValidValue(fields()[2], other.name)) {
this.name = data().deepCopy(fields()[2].schema(), other.name);
fieldSetFlags()[2] = true;
}
if (isValidValue(fields()[3], other.start)) {
this.start = data().deepCopy(fields()[3].schema(), other.start);
fieldSetFlags()[3] = true;
}
if (isValidValue(fields()[4], other.end)) {
this.end = data().deepCopy(fields()[4].schema(), other.end);
fieldSetFlags()[4] = true;
}
}
/** Gets the value of the 'chromosome' field */
public java.lang.String getChromosome() {
return chromosome;
}
/** Sets the value of the 'chromosome' field */
public org.opencb.biodata.models.variant.avro.Cytoband.Builder setChromosome(java.lang.String value) {
validate(fields()[0], value);
this.chromosome = value;
fieldSetFlags()[0] = true;
return this;
}
/** Checks whether the 'chromosome' field has been set */
public boolean hasChromosome() {
return fieldSetFlags()[0];
}
/** Clears the value of the 'chromosome' field */
public org.opencb.biodata.models.variant.avro.Cytoband.Builder clearChromosome() {
chromosome = null;
fieldSetFlags()[0] = false;
return this;
}
/** Gets the value of the 'stain' field */
public java.lang.String getStain() {
return stain;
}
/** Sets the value of the 'stain' field */
public org.opencb.biodata.models.variant.avro.Cytoband.Builder setStain(java.lang.String value) {
validate(fields()[1], value);
this.stain = value;
fieldSetFlags()[1] = true;
return this;
}
/** Checks whether the 'stain' field has been set */
public boolean hasStain() {
return fieldSetFlags()[1];
}
/** Clears the value of the 'stain' field */
public org.opencb.biodata.models.variant.avro.Cytoband.Builder clearStain() {
stain = null;
fieldSetFlags()[1] = 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.Cytoband.Builder setName(java.lang.String value) {
validate(fields()[2], value);
this.name = value;
fieldSetFlags()[2] = true;
return this;
}
/** Checks whether the 'name' field has been set */
public boolean hasName() {
return fieldSetFlags()[2];
}
/** Clears the value of the 'name' field */
public org.opencb.biodata.models.variant.avro.Cytoband.Builder clearName() {
name = null;
fieldSetFlags()[2] = false;
return this;
}
/** Gets the value of the 'start' field */
public java.lang.Integer getStart() {
return start;
}
/** Sets the value of the 'start' field */
public org.opencb.biodata.models.variant.avro.Cytoband.Builder setStart(java.lang.Integer value) {
validate(fields()[3], value);
this.start = value;
fieldSetFlags()[3] = true;
return this;
}
/** Checks whether the 'start' field has been set */
public boolean hasStart() {
return fieldSetFlags()[3];
}
/** Clears the value of the 'start' field */
public org.opencb.biodata.models.variant.avro.Cytoband.Builder clearStart() {
start = null;
fieldSetFlags()[3] = false;
return this;
}
/** Gets the value of the 'end' field */
public java.lang.Integer getEnd() {
return end;
}
/** Sets the value of the 'end' field */
public org.opencb.biodata.models.variant.avro.Cytoband.Builder setEnd(java.lang.Integer value) {
validate(fields()[4], value);
this.end = value;
fieldSetFlags()[4] = true;
return this;
}
/** Checks whether the 'end' field has been set */
public boolean hasEnd() {
return fieldSetFlags()[4];
}
/** Clears the value of the 'end' field */
public org.opencb.biodata.models.variant.avro.Cytoband.Builder clearEnd() {
end = null;
fieldSetFlags()[4] = false;
return this;
}
@Override
public Cytoband build() {
try {
Cytoband record = new Cytoband();
record.chromosome = fieldSetFlags()[0] ? this.chromosome : (java.lang.String) defaultValue(fields()[0]);
record.stain = fieldSetFlags()[1] ? this.stain : (java.lang.String) defaultValue(fields()[1]);
record.name = fieldSetFlags()[2] ? this.name : (java.lang.String) defaultValue(fields()[2]);
record.start = fieldSetFlags()[3] ? this.start : (java.lang.Integer) defaultValue(fields()[3]);
record.end = fieldSetFlags()[4] ? this.end : (java.lang.Integer) defaultValue(fields()[4]);
return record;
} catch (Exception e) {
throw new org.apache.avro.AvroRuntimeException(e);
}
}
}
}