org.gel.models.report.avro.Intervention Maven / Gradle / Ivy
/**
* Autogenerated by Avro
*
* DO NOT EDIT DIRECTLY
*/
package org.gel.models.report.avro;
@SuppressWarnings("all")
/** A process or action that is the focus of a clinical study.
Ref. https://prsinfo.clinicaltrials.gov/definitions.html */
@org.apache.avro.specific.AvroGenerated
public class Intervention 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\":\"Intervention\",\"namespace\":\"org.gel.models.report.avro\",\"doc\":\"A process or action that is the focus of a clinical study.\\n Ref. https://prsinfo.clinicaltrials.gov/definitions.html\",\"fields\":[{\"name\":\"interventionType\",\"type\":{\"type\":\"enum\",\"name\":\"InterventionType\",\"doc\":\"For each intervention studied in the clinical study, the general type of intervention\\n\\n* `drug`: Including placebo\\n* `device`: Including sham\\n* `biological`: Vaccine\\n* `procedure`: Surgery\\n* `radiation`\\n* `behavioral`: For example, psychotherapy, lifestyle counselling\\n* `genetic`: Including gene transfer, stem cell and recombinant DNA\\n* `dietary_supplement`: For example, vitamins, minerals\\n* `combination_product`: Combining a drug and device, a biological product and device; a drug and biological product; or a drug, biological product, and device\\n* `diagnostic_test`: For example, imaging, in-vitro\\n* `other`\\n\\n Ref. https://prsinfo.clinicaltrials.gov/definitions.htm\",\"symbols\":[\"drug\",\"device\",\"procedure\",\"biological\",\"radiation\",\"behavioral\",\"genetic\",\"dietary_supplement\",\"combination_product\",\"diagnostic_test\",\"other\"]},\"doc\":\"Intervention type, i.e drug\"},{\"name\":\"interventionName\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"},\"doc\":\"Intervention name: Placebo\"}]}");
public static org.apache.avro.Schema getClassSchema() { return SCHEMA$; }
/** Intervention type, i.e drug */
private org.gel.models.report.avro.InterventionType interventionType;
/** Intervention name: Placebo */
private java.lang.String interventionName;
/**
* 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 Intervention() {}
/**
* All-args constructor.
*/
public Intervention(org.gel.models.report.avro.InterventionType interventionType, java.lang.String interventionName) {
this.interventionType = interventionType;
this.interventionName = interventionName;
}
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 interventionType;
case 1: return interventionName;
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: interventionType = (org.gel.models.report.avro.InterventionType)value$; break;
case 1: interventionName = (java.lang.String)value$; break;
default: throw new org.apache.avro.AvroRuntimeException("Bad index");
}
}
/**
* Gets the value of the 'interventionType' field.
* Intervention type, i.e drug */
public org.gel.models.report.avro.InterventionType getInterventionType() {
return interventionType;
}
/**
* Sets the value of the 'interventionType' field.
* Intervention type, i.e drug * @param value the value to set.
*/
public void setInterventionType(org.gel.models.report.avro.InterventionType value) {
this.interventionType = value;
}
/**
* Gets the value of the 'interventionName' field.
* Intervention name: Placebo */
public java.lang.String getInterventionName() {
return interventionName;
}
/**
* Sets the value of the 'interventionName' field.
* Intervention name: Placebo * @param value the value to set.
*/
public void setInterventionName(java.lang.String value) {
this.interventionName = value;
}
/** Creates a new Intervention RecordBuilder */
public static org.gel.models.report.avro.Intervention.Builder newBuilder() {
return new org.gel.models.report.avro.Intervention.Builder();
}
/** Creates a new Intervention RecordBuilder by copying an existing Builder */
public static org.gel.models.report.avro.Intervention.Builder newBuilder(org.gel.models.report.avro.Intervention.Builder other) {
return new org.gel.models.report.avro.Intervention.Builder(other);
}
/** Creates a new Intervention RecordBuilder by copying an existing Intervention instance */
public static org.gel.models.report.avro.Intervention.Builder newBuilder(org.gel.models.report.avro.Intervention other) {
return new org.gel.models.report.avro.Intervention.Builder(other);
}
/**
* RecordBuilder for Intervention instances.
*/
public static class Builder extends org.apache.avro.specific.SpecificRecordBuilderBase
implements org.apache.avro.data.RecordBuilder {
private org.gel.models.report.avro.InterventionType interventionType;
private java.lang.String interventionName;
/** Creates a new Builder */
private Builder() {
super(org.gel.models.report.avro.Intervention.SCHEMA$);
}
/** Creates a Builder by copying an existing Builder */
private Builder(org.gel.models.report.avro.Intervention.Builder other) {
super(other);
if (isValidValue(fields()[0], other.interventionType)) {
this.interventionType = data().deepCopy(fields()[0].schema(), other.interventionType);
fieldSetFlags()[0] = true;
}
if (isValidValue(fields()[1], other.interventionName)) {
this.interventionName = data().deepCopy(fields()[1].schema(), other.interventionName);
fieldSetFlags()[1] = true;
}
}
/** Creates a Builder by copying an existing Intervention instance */
private Builder(org.gel.models.report.avro.Intervention other) {
super(org.gel.models.report.avro.Intervention.SCHEMA$);
if (isValidValue(fields()[0], other.interventionType)) {
this.interventionType = data().deepCopy(fields()[0].schema(), other.interventionType);
fieldSetFlags()[0] = true;
}
if (isValidValue(fields()[1], other.interventionName)) {
this.interventionName = data().deepCopy(fields()[1].schema(), other.interventionName);
fieldSetFlags()[1] = true;
}
}
/** Gets the value of the 'interventionType' field */
public org.gel.models.report.avro.InterventionType getInterventionType() {
return interventionType;
}
/** Sets the value of the 'interventionType' field */
public org.gel.models.report.avro.Intervention.Builder setInterventionType(org.gel.models.report.avro.InterventionType value) {
validate(fields()[0], value);
this.interventionType = value;
fieldSetFlags()[0] = true;
return this;
}
/** Checks whether the 'interventionType' field has been set */
public boolean hasInterventionType() {
return fieldSetFlags()[0];
}
/** Clears the value of the 'interventionType' field */
public org.gel.models.report.avro.Intervention.Builder clearInterventionType() {
interventionType = null;
fieldSetFlags()[0] = false;
return this;
}
/** Gets the value of the 'interventionName' field */
public java.lang.String getInterventionName() {
return interventionName;
}
/** Sets the value of the 'interventionName' field */
public org.gel.models.report.avro.Intervention.Builder setInterventionName(java.lang.String value) {
validate(fields()[1], value);
this.interventionName = value;
fieldSetFlags()[1] = true;
return this;
}
/** Checks whether the 'interventionName' field has been set */
public boolean hasInterventionName() {
return fieldSetFlags()[1];
}
/** Clears the value of the 'interventionName' field */
public org.gel.models.report.avro.Intervention.Builder clearInterventionName() {
interventionName = null;
fieldSetFlags()[1] = false;
return this;
}
@Override
public Intervention build() {
try {
Intervention record = new Intervention();
record.interventionType = fieldSetFlags()[0] ? this.interventionType : (org.gel.models.report.avro.InterventionType) defaultValue(fields()[0]);
record.interventionName = fieldSetFlags()[1] ? this.interventionName : (java.lang.String) defaultValue(fields()[1]);
return record;
} catch (Exception e) {
throw new org.apache.avro.AvroRuntimeException(e);
}
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy