org.gel.models.participant.avro.DiseasePenetrance Maven / Gradle / Ivy
/**
* Autogenerated by Avro
*
* DO NOT EDIT DIRECTLY
*/
package org.gel.models.participant.avro;
@SuppressWarnings("all")
/** A disease penetrance definition */
@org.apache.avro.specific.AvroGenerated
public class DiseasePenetrance 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\":\"DiseasePenetrance\",\"namespace\":\"org.gel.models.participant.avro\",\"doc\":\"A disease penetrance definition\",\"fields\":[{\"name\":\"specificDisease\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"},\"doc\":\"The disease to which the penetrance applies\"},{\"name\":\"penetrance\",\"type\":{\"type\":\"enum\",\"name\":\"Penetrance\",\"doc\":\"Penetrance assumed in the analysis\",\"symbols\":[\"complete\",\"incomplete\"]},\"doc\":\"The penetrance\"}]}");
public static org.apache.avro.Schema getClassSchema() { return SCHEMA$; }
/** The disease to which the penetrance applies */
private java.lang.String specificDisease;
/** The penetrance */
private org.gel.models.participant.avro.Penetrance penetrance;
/**
* 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 DiseasePenetrance() {}
/**
* All-args constructor.
*/
public DiseasePenetrance(java.lang.String specificDisease, org.gel.models.participant.avro.Penetrance penetrance) {
this.specificDisease = specificDisease;
this.penetrance = penetrance;
}
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 specificDisease;
case 1: return penetrance;
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: specificDisease = (java.lang.String)value$; break;
case 1: penetrance = (org.gel.models.participant.avro.Penetrance)value$; break;
default: throw new org.apache.avro.AvroRuntimeException("Bad index");
}
}
/**
* Gets the value of the 'specificDisease' field.
* The disease to which the penetrance applies */
public java.lang.String getSpecificDisease() {
return specificDisease;
}
/**
* Sets the value of the 'specificDisease' field.
* The disease to which the penetrance applies * @param value the value to set.
*/
public void setSpecificDisease(java.lang.String value) {
this.specificDisease = value;
}
/**
* Gets the value of the 'penetrance' field.
* The penetrance */
public org.gel.models.participant.avro.Penetrance getPenetrance() {
return penetrance;
}
/**
* Sets the value of the 'penetrance' field.
* The penetrance * @param value the value to set.
*/
public void setPenetrance(org.gel.models.participant.avro.Penetrance value) {
this.penetrance = value;
}
/** Creates a new DiseasePenetrance RecordBuilder */
public static org.gel.models.participant.avro.DiseasePenetrance.Builder newBuilder() {
return new org.gel.models.participant.avro.DiseasePenetrance.Builder();
}
/** Creates a new DiseasePenetrance RecordBuilder by copying an existing Builder */
public static org.gel.models.participant.avro.DiseasePenetrance.Builder newBuilder(org.gel.models.participant.avro.DiseasePenetrance.Builder other) {
return new org.gel.models.participant.avro.DiseasePenetrance.Builder(other);
}
/** Creates a new DiseasePenetrance RecordBuilder by copying an existing DiseasePenetrance instance */
public static org.gel.models.participant.avro.DiseasePenetrance.Builder newBuilder(org.gel.models.participant.avro.DiseasePenetrance other) {
return new org.gel.models.participant.avro.DiseasePenetrance.Builder(other);
}
/**
* RecordBuilder for DiseasePenetrance instances.
*/
public static class Builder extends org.apache.avro.specific.SpecificRecordBuilderBase
implements org.apache.avro.data.RecordBuilder {
private java.lang.String specificDisease;
private org.gel.models.participant.avro.Penetrance penetrance;
/** Creates a new Builder */
private Builder() {
super(org.gel.models.participant.avro.DiseasePenetrance.SCHEMA$);
}
/** Creates a Builder by copying an existing Builder */
private Builder(org.gel.models.participant.avro.DiseasePenetrance.Builder other) {
super(other);
if (isValidValue(fields()[0], other.specificDisease)) {
this.specificDisease = data().deepCopy(fields()[0].schema(), other.specificDisease);
fieldSetFlags()[0] = true;
}
if (isValidValue(fields()[1], other.penetrance)) {
this.penetrance = data().deepCopy(fields()[1].schema(), other.penetrance);
fieldSetFlags()[1] = true;
}
}
/** Creates a Builder by copying an existing DiseasePenetrance instance */
private Builder(org.gel.models.participant.avro.DiseasePenetrance other) {
super(org.gel.models.participant.avro.DiseasePenetrance.SCHEMA$);
if (isValidValue(fields()[0], other.specificDisease)) {
this.specificDisease = data().deepCopy(fields()[0].schema(), other.specificDisease);
fieldSetFlags()[0] = true;
}
if (isValidValue(fields()[1], other.penetrance)) {
this.penetrance = data().deepCopy(fields()[1].schema(), other.penetrance);
fieldSetFlags()[1] = true;
}
}
/** Gets the value of the 'specificDisease' field */
public java.lang.String getSpecificDisease() {
return specificDisease;
}
/** Sets the value of the 'specificDisease' field */
public org.gel.models.participant.avro.DiseasePenetrance.Builder setSpecificDisease(java.lang.String value) {
validate(fields()[0], value);
this.specificDisease = value;
fieldSetFlags()[0] = true;
return this;
}
/** Checks whether the 'specificDisease' field has been set */
public boolean hasSpecificDisease() {
return fieldSetFlags()[0];
}
/** Clears the value of the 'specificDisease' field */
public org.gel.models.participant.avro.DiseasePenetrance.Builder clearSpecificDisease() {
specificDisease = null;
fieldSetFlags()[0] = false;
return this;
}
/** Gets the value of the 'penetrance' field */
public org.gel.models.participant.avro.Penetrance getPenetrance() {
return penetrance;
}
/** Sets the value of the 'penetrance' field */
public org.gel.models.participant.avro.DiseasePenetrance.Builder setPenetrance(org.gel.models.participant.avro.Penetrance value) {
validate(fields()[1], value);
this.penetrance = value;
fieldSetFlags()[1] = true;
return this;
}
/** Checks whether the 'penetrance' field has been set */
public boolean hasPenetrance() {
return fieldSetFlags()[1];
}
/** Clears the value of the 'penetrance' field */
public org.gel.models.participant.avro.DiseasePenetrance.Builder clearPenetrance() {
penetrance = null;
fieldSetFlags()[1] = false;
return this;
}
@Override
public DiseasePenetrance build() {
try {
DiseasePenetrance record = new DiseasePenetrance();
record.specificDisease = fieldSetFlags()[0] ? this.specificDisease : (java.lang.String) defaultValue(fields()[0]);
record.penetrance = fieldSetFlags()[1] ? this.penetrance : (org.gel.models.participant.avro.Penetrance) defaultValue(fields()[1]);
return record;
} catch (Exception e) {
throw new org.apache.avro.AvroRuntimeException(e);
}
}
}
}