org.opencb.biodata.models.sequence.Read Maven / Gradle / Ivy
The newest version!
/**
* Autogenerated by Avro
*
* DO NOT EDIT DIRECTLY
*/
package org.opencb.biodata.models.sequence;
@SuppressWarnings("all")
@org.apache.avro.specific.AvroGenerated
public class Read 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\":\"Read\",\"namespace\":\"org.opencb.biodata.models.sequence\",\"fields\":[{\"name\":\"id\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"},\"doc\":\"The read ID.\"},{\"name\":\"sequence\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"},\"doc\":\"The full read sequence.\"},{\"name\":\"quality\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"},\"doc\":\"The full read quality.\"}]}");
public static org.apache.avro.Schema getClassSchema() { return SCHEMA$; }
/** The read ID. */
private java.lang.String id;
/** The full read sequence. */
private java.lang.String sequence;
/** The full read quality. */
private java.lang.String quality;
/**
* 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 Read() {}
/**
* All-args constructor.
*/
public Read(java.lang.String id, java.lang.String sequence, java.lang.String quality) {
this.id = id;
this.sequence = sequence;
this.quality = quality;
}
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 sequence;
case 2: return quality;
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: sequence = (java.lang.String)value$; break;
case 2: quality = (java.lang.String)value$; break;
default: throw new org.apache.avro.AvroRuntimeException("Bad index");
}
}
/**
* Gets the value of the 'id' field.
* The read ID. */
public java.lang.String getId() {
return id;
}
/**
* Sets the value of the 'id' field.
* The read ID. * @param value the value to set.
*/
public void setId(java.lang.String value) {
this.id = value;
}
/**
* Gets the value of the 'sequence' field.
* The full read sequence. */
public java.lang.String getSequence() {
return sequence;
}
/**
* Sets the value of the 'sequence' field.
* The full read sequence. * @param value the value to set.
*/
public void setSequence(java.lang.String value) {
this.sequence = value;
}
/**
* Gets the value of the 'quality' field.
* The full read quality. */
public java.lang.String getQuality() {
return quality;
}
/**
* Sets the value of the 'quality' field.
* The full read quality. * @param value the value to set.
*/
public void setQuality(java.lang.String value) {
this.quality = value;
}
/** Creates a new Read RecordBuilder */
public static org.opencb.biodata.models.sequence.Read.Builder newBuilder() {
return new org.opencb.biodata.models.sequence.Read.Builder();
}
/** Creates a new Read RecordBuilder by copying an existing Builder */
public static org.opencb.biodata.models.sequence.Read.Builder newBuilder(org.opencb.biodata.models.sequence.Read.Builder other) {
return new org.opencb.biodata.models.sequence.Read.Builder(other);
}
/** Creates a new Read RecordBuilder by copying an existing Read instance */
public static org.opencb.biodata.models.sequence.Read.Builder newBuilder(org.opencb.biodata.models.sequence.Read other) {
return new org.opencb.biodata.models.sequence.Read.Builder(other);
}
/**
* RecordBuilder for Read 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 sequence;
private java.lang.String quality;
/** Creates a new Builder */
private Builder() {
super(org.opencb.biodata.models.sequence.Read.SCHEMA$);
}
/** Creates a Builder by copying an existing Builder */
private Builder(org.opencb.biodata.models.sequence.Read.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.sequence)) {
this.sequence = data().deepCopy(fields()[1].schema(), other.sequence);
fieldSetFlags()[1] = true;
}
if (isValidValue(fields()[2], other.quality)) {
this.quality = data().deepCopy(fields()[2].schema(), other.quality);
fieldSetFlags()[2] = true;
}
}
/** Creates a Builder by copying an existing Read instance */
private Builder(org.opencb.biodata.models.sequence.Read other) {
super(org.opencb.biodata.models.sequence.Read.SCHEMA$);
if (isValidValue(fields()[0], other.id)) {
this.id = data().deepCopy(fields()[0].schema(), other.id);
fieldSetFlags()[0] = true;
}
if (isValidValue(fields()[1], other.sequence)) {
this.sequence = data().deepCopy(fields()[1].schema(), other.sequence);
fieldSetFlags()[1] = true;
}
if (isValidValue(fields()[2], other.quality)) {
this.quality = data().deepCopy(fields()[2].schema(), other.quality);
fieldSetFlags()[2] = 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.sequence.Read.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.sequence.Read.Builder clearId() {
id = null;
fieldSetFlags()[0] = false;
return this;
}
/** Gets the value of the 'sequence' field */
public java.lang.String getSequence() {
return sequence;
}
/** Sets the value of the 'sequence' field */
public org.opencb.biodata.models.sequence.Read.Builder setSequence(java.lang.String value) {
validate(fields()[1], value);
this.sequence = value;
fieldSetFlags()[1] = true;
return this;
}
/** Checks whether the 'sequence' field has been set */
public boolean hasSequence() {
return fieldSetFlags()[1];
}
/** Clears the value of the 'sequence' field */
public org.opencb.biodata.models.sequence.Read.Builder clearSequence() {
sequence = null;
fieldSetFlags()[1] = false;
return this;
}
/** Gets the value of the 'quality' field */
public java.lang.String getQuality() {
return quality;
}
/** Sets the value of the 'quality' field */
public org.opencb.biodata.models.sequence.Read.Builder setQuality(java.lang.String value) {
validate(fields()[2], value);
this.quality = value;
fieldSetFlags()[2] = true;
return this;
}
/** Checks whether the 'quality' field has been set */
public boolean hasQuality() {
return fieldSetFlags()[2];
}
/** Clears the value of the 'quality' field */
public org.opencb.biodata.models.sequence.Read.Builder clearQuality() {
quality = null;
fieldSetFlags()[2] = false;
return this;
}
@Override
public Read build() {
try {
Read record = new Read();
record.id = fieldSetFlags()[0] ? this.id : (java.lang.String) defaultValue(fields()[0]);
record.sequence = fieldSetFlags()[1] ? this.sequence : (java.lang.String) defaultValue(fields()[1]);
record.quality = fieldSetFlags()[2] ? this.quality : (java.lang.String) defaultValue(fields()[2]);
return record;
} catch (Exception e) {
throw new org.apache.avro.AvroRuntimeException(e);
}
}
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy