org.gel.models.report.avro.VariantValidation Maven / Gradle / Ivy
/**
* Autogenerated by Avro
*
* DO NOT EDIT DIRECTLY
*/
package org.gel.models.report.avro;
@SuppressWarnings("all")
@org.apache.avro.specific.AvroGenerated
public class VariantValidation 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\":\"VariantValidation\",\"namespace\":\"org.gel.models.report.avro\",\"fields\":[{\"name\":\"validationTechnology\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"},\"doc\":\"Technology used to perform secondary confirmation of this variant (e.g. Sanger)\"},{\"name\":\"validationResult\",\"type\":{\"type\":\"enum\",\"name\":\"ValidationResult\",\"symbols\":[\"NotPerformed\",\"Confirmed\",\"NotConfirmed\",\"Pending\"]},\"doc\":\"Status/outcome of validation\"}]}");
public static org.apache.avro.Schema getClassSchema() { return SCHEMA$; }
/** Technology used to perform secondary confirmation of this variant (e.g. Sanger) */
private java.lang.String validationTechnology;
/** Status/outcome of validation */
private org.gel.models.report.avro.ValidationResult validationResult;
/**
* 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 VariantValidation() {}
/**
* All-args constructor.
*/
public VariantValidation(java.lang.String validationTechnology, org.gel.models.report.avro.ValidationResult validationResult) {
this.validationTechnology = validationTechnology;
this.validationResult = validationResult;
}
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 validationTechnology;
case 1: return validationResult;
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: validationTechnology = (java.lang.String)value$; break;
case 1: validationResult = (org.gel.models.report.avro.ValidationResult)value$; break;
default: throw new org.apache.avro.AvroRuntimeException("Bad index");
}
}
/**
* Gets the value of the 'validationTechnology' field.
* Technology used to perform secondary confirmation of this variant (e.g. Sanger) */
public java.lang.String getValidationTechnology() {
return validationTechnology;
}
/**
* Sets the value of the 'validationTechnology' field.
* Technology used to perform secondary confirmation of this variant (e.g. Sanger) * @param value the value to set.
*/
public void setValidationTechnology(java.lang.String value) {
this.validationTechnology = value;
}
/**
* Gets the value of the 'validationResult' field.
* Status/outcome of validation */
public org.gel.models.report.avro.ValidationResult getValidationResult() {
return validationResult;
}
/**
* Sets the value of the 'validationResult' field.
* Status/outcome of validation * @param value the value to set.
*/
public void setValidationResult(org.gel.models.report.avro.ValidationResult value) {
this.validationResult = value;
}
/** Creates a new VariantValidation RecordBuilder */
public static org.gel.models.report.avro.VariantValidation.Builder newBuilder() {
return new org.gel.models.report.avro.VariantValidation.Builder();
}
/** Creates a new VariantValidation RecordBuilder by copying an existing Builder */
public static org.gel.models.report.avro.VariantValidation.Builder newBuilder(org.gel.models.report.avro.VariantValidation.Builder other) {
return new org.gel.models.report.avro.VariantValidation.Builder(other);
}
/** Creates a new VariantValidation RecordBuilder by copying an existing VariantValidation instance */
public static org.gel.models.report.avro.VariantValidation.Builder newBuilder(org.gel.models.report.avro.VariantValidation other) {
return new org.gel.models.report.avro.VariantValidation.Builder(other);
}
/**
* RecordBuilder for VariantValidation instances.
*/
public static class Builder extends org.apache.avro.specific.SpecificRecordBuilderBase
implements org.apache.avro.data.RecordBuilder {
private java.lang.String validationTechnology;
private org.gel.models.report.avro.ValidationResult validationResult;
/** Creates a new Builder */
private Builder() {
super(org.gel.models.report.avro.VariantValidation.SCHEMA$);
}
/** Creates a Builder by copying an existing Builder */
private Builder(org.gel.models.report.avro.VariantValidation.Builder other) {
super(other);
if (isValidValue(fields()[0], other.validationTechnology)) {
this.validationTechnology = data().deepCopy(fields()[0].schema(), other.validationTechnology);
fieldSetFlags()[0] = true;
}
if (isValidValue(fields()[1], other.validationResult)) {
this.validationResult = data().deepCopy(fields()[1].schema(), other.validationResult);
fieldSetFlags()[1] = true;
}
}
/** Creates a Builder by copying an existing VariantValidation instance */
private Builder(org.gel.models.report.avro.VariantValidation other) {
super(org.gel.models.report.avro.VariantValidation.SCHEMA$);
if (isValidValue(fields()[0], other.validationTechnology)) {
this.validationTechnology = data().deepCopy(fields()[0].schema(), other.validationTechnology);
fieldSetFlags()[0] = true;
}
if (isValidValue(fields()[1], other.validationResult)) {
this.validationResult = data().deepCopy(fields()[1].schema(), other.validationResult);
fieldSetFlags()[1] = true;
}
}
/** Gets the value of the 'validationTechnology' field */
public java.lang.String getValidationTechnology() {
return validationTechnology;
}
/** Sets the value of the 'validationTechnology' field */
public org.gel.models.report.avro.VariantValidation.Builder setValidationTechnology(java.lang.String value) {
validate(fields()[0], value);
this.validationTechnology = value;
fieldSetFlags()[0] = true;
return this;
}
/** Checks whether the 'validationTechnology' field has been set */
public boolean hasValidationTechnology() {
return fieldSetFlags()[0];
}
/** Clears the value of the 'validationTechnology' field */
public org.gel.models.report.avro.VariantValidation.Builder clearValidationTechnology() {
validationTechnology = null;
fieldSetFlags()[0] = false;
return this;
}
/** Gets the value of the 'validationResult' field */
public org.gel.models.report.avro.ValidationResult getValidationResult() {
return validationResult;
}
/** Sets the value of the 'validationResult' field */
public org.gel.models.report.avro.VariantValidation.Builder setValidationResult(org.gel.models.report.avro.ValidationResult value) {
validate(fields()[1], value);
this.validationResult = value;
fieldSetFlags()[1] = true;
return this;
}
/** Checks whether the 'validationResult' field has been set */
public boolean hasValidationResult() {
return fieldSetFlags()[1];
}
/** Clears the value of the 'validationResult' field */
public org.gel.models.report.avro.VariantValidation.Builder clearValidationResult() {
validationResult = null;
fieldSetFlags()[1] = false;
return this;
}
@Override
public VariantValidation build() {
try {
VariantValidation record = new VariantValidation();
record.validationTechnology = fieldSetFlags()[0] ? this.validationTechnology : (java.lang.String) defaultValue(fields()[0]);
record.validationResult = fieldSetFlags()[1] ? this.validationResult : (org.gel.models.report.avro.ValidationResult) defaultValue(fields()[1]);
return record;
} catch (Exception e) {
throw new org.apache.avro.AvroRuntimeException(e);
}
}
}
}