org.opencb.biodata.models.variant.avro.IssueEntry 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 IssueEntry 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\":\"IssueEntry\",\"namespace\":\"org.opencb.biodata.models.variant.avro\",\"fields\":[{\"name\":\"type\",\"type\":{\"type\":\"enum\",\"name\":\"IssueType\",\"symbols\":[\"DUPLICATION\",\"DISCREPANCY\",\"MENDELIAN_ERROR\",\"DE_NOVO\",\"COMPOUND_HETEROZYGOUS\"]}},{\"name\":\"sample\",\"type\":{\"type\":\"record\",\"name\":\"SampleEntry\",\"fields\":[{\"name\":\"sampleId\",\"type\":[\"null\",{\"type\":\"string\",\"avro.java.string\":\"String\"}]},{\"name\":\"fileIndex\",\"type\":[\"null\",\"int\"]},{\"name\":\"data\",\"type\":{\"type\":\"array\",\"items\":{\"type\":\"string\",\"avro.java.string\":\"String\"}}}]}},{\"name\":\"data\",\"type\":{\"type\":\"map\",\"values\":{\"type\":\"string\",\"avro.java.string\":\"String\"},\"avro.java.string\":\"String\"}}]}");
public static org.apache.avro.Schema getClassSchema() { return SCHEMA$; }
private org.opencb.biodata.models.variant.avro.IssueType type;
private org.opencb.biodata.models.variant.avro.SampleEntry sample;
private java.util.Map data;
/**
* 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 IssueEntry() {}
/**
* All-args constructor.
*/
public IssueEntry(org.opencb.biodata.models.variant.avro.IssueType type, org.opencb.biodata.models.variant.avro.SampleEntry sample, java.util.Map data) {
this.type = type;
this.sample = sample;
this.data = data;
}
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 type;
case 1: return sample;
case 2: return data;
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: type = (org.opencb.biodata.models.variant.avro.IssueType)value$; break;
case 1: sample = (org.opencb.biodata.models.variant.avro.SampleEntry)value$; break;
case 2: data = (java.util.Map)value$; break;
default: throw new org.apache.avro.AvroRuntimeException("Bad index");
}
}
/**
* Gets the value of the 'type' field.
*/
public org.opencb.biodata.models.variant.avro.IssueType getType() {
return type;
}
/**
* Sets the value of the 'type' field.
* @param value the value to set.
*/
public void setType(org.opencb.biodata.models.variant.avro.IssueType value) {
this.type = value;
}
/**
* Gets the value of the 'sample' field.
*/
public org.opencb.biodata.models.variant.avro.SampleEntry getSample() {
return sample;
}
/**
* Sets the value of the 'sample' field.
* @param value the value to set.
*/
public void setSample(org.opencb.biodata.models.variant.avro.SampleEntry value) {
this.sample = value;
}
/**
* Gets the value of the 'data' field.
*/
public java.util.Map getData() {
return data;
}
/**
* Sets the value of the 'data' field.
* @param value the value to set.
*/
public void setData(java.util.Map value) {
this.data = value;
}
/** Creates a new IssueEntry RecordBuilder */
public static org.opencb.biodata.models.variant.avro.IssueEntry.Builder newBuilder() {
return new org.opencb.biodata.models.variant.avro.IssueEntry.Builder();
}
/** Creates a new IssueEntry RecordBuilder by copying an existing Builder */
public static org.opencb.biodata.models.variant.avro.IssueEntry.Builder newBuilder(org.opencb.biodata.models.variant.avro.IssueEntry.Builder other) {
return new org.opencb.biodata.models.variant.avro.IssueEntry.Builder(other);
}
/** Creates a new IssueEntry RecordBuilder by copying an existing IssueEntry instance */
public static org.opencb.biodata.models.variant.avro.IssueEntry.Builder newBuilder(org.opencb.biodata.models.variant.avro.IssueEntry other) {
return new org.opencb.biodata.models.variant.avro.IssueEntry.Builder(other);
}
/**
* RecordBuilder for IssueEntry instances.
*/
public static class Builder extends org.apache.avro.specific.SpecificRecordBuilderBase
implements org.apache.avro.data.RecordBuilder {
private org.opencb.biodata.models.variant.avro.IssueType type;
private org.opencb.biodata.models.variant.avro.SampleEntry sample;
private java.util.Map data;
/** Creates a new Builder */
private Builder() {
super(org.opencb.biodata.models.variant.avro.IssueEntry.SCHEMA$);
}
/** Creates a Builder by copying an existing Builder */
private Builder(org.opencb.biodata.models.variant.avro.IssueEntry.Builder other) {
super(other);
if (isValidValue(fields()[0], other.type)) {
this.type = data().deepCopy(fields()[0].schema(), other.type);
fieldSetFlags()[0] = true;
}
if (isValidValue(fields()[1], other.sample)) {
this.sample = data().deepCopy(fields()[1].schema(), other.sample);
fieldSetFlags()[1] = true;
}
if (isValidValue(fields()[2], other.data)) {
this.data = data().deepCopy(fields()[2].schema(), other.data);
fieldSetFlags()[2] = true;
}
}
/** Creates a Builder by copying an existing IssueEntry instance */
private Builder(org.opencb.biodata.models.variant.avro.IssueEntry other) {
super(org.opencb.biodata.models.variant.avro.IssueEntry.SCHEMA$);
if (isValidValue(fields()[0], other.type)) {
this.type = data().deepCopy(fields()[0].schema(), other.type);
fieldSetFlags()[0] = true;
}
if (isValidValue(fields()[1], other.sample)) {
this.sample = data().deepCopy(fields()[1].schema(), other.sample);
fieldSetFlags()[1] = true;
}
if (isValidValue(fields()[2], other.data)) {
this.data = data().deepCopy(fields()[2].schema(), other.data);
fieldSetFlags()[2] = true;
}
}
/** Gets the value of the 'type' field */
public org.opencb.biodata.models.variant.avro.IssueType getType() {
return type;
}
/** Sets the value of the 'type' field */
public org.opencb.biodata.models.variant.avro.IssueEntry.Builder setType(org.opencb.biodata.models.variant.avro.IssueType value) {
validate(fields()[0], value);
this.type = value;
fieldSetFlags()[0] = true;
return this;
}
/** Checks whether the 'type' field has been set */
public boolean hasType() {
return fieldSetFlags()[0];
}
/** Clears the value of the 'type' field */
public org.opencb.biodata.models.variant.avro.IssueEntry.Builder clearType() {
type = null;
fieldSetFlags()[0] = false;
return this;
}
/** Gets the value of the 'sample' field */
public org.opencb.biodata.models.variant.avro.SampleEntry getSample() {
return sample;
}
/** Sets the value of the 'sample' field */
public org.opencb.biodata.models.variant.avro.IssueEntry.Builder setSample(org.opencb.biodata.models.variant.avro.SampleEntry value) {
validate(fields()[1], value);
this.sample = value;
fieldSetFlags()[1] = true;
return this;
}
/** Checks whether the 'sample' field has been set */
public boolean hasSample() {
return fieldSetFlags()[1];
}
/** Clears the value of the 'sample' field */
public org.opencb.biodata.models.variant.avro.IssueEntry.Builder clearSample() {
sample = null;
fieldSetFlags()[1] = false;
return this;
}
/** Gets the value of the 'data' field */
public java.util.Map getData() {
return data;
}
/** Sets the value of the 'data' field */
public org.opencb.biodata.models.variant.avro.IssueEntry.Builder setData(java.util.Map value) {
validate(fields()[2], value);
this.data = value;
fieldSetFlags()[2] = true;
return this;
}
/** Checks whether the 'data' field has been set */
public boolean hasData() {
return fieldSetFlags()[2];
}
/** Clears the value of the 'data' field */
public org.opencb.biodata.models.variant.avro.IssueEntry.Builder clearData() {
data = null;
fieldSetFlags()[2] = false;
return this;
}
@Override
public IssueEntry build() {
try {
IssueEntry record = new IssueEntry();
record.type = fieldSetFlags()[0] ? this.type : (org.opencb.biodata.models.variant.avro.IssueType) defaultValue(fields()[0]);
record.sample = fieldSetFlags()[1] ? this.sample : (org.opencb.biodata.models.variant.avro.SampleEntry) defaultValue(fields()[1]);
record.data = fieldSetFlags()[2] ? this.data : (java.util.Map) defaultValue(fields()[2]);
return record;
} catch (Exception e) {
throw new org.apache.avro.AvroRuntimeException(e);
}
}
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy