All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.gel.models.report.avro.DrugResponse 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 DrugResponse 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\":\"DrugResponse\",\"namespace\":\"org.gel.models.report.avro\",\"fields\":[{\"name\":\"TreatmentAgent\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"},\"doc\":\"Treatment agent\"},{\"name\":\"drugResponseClassification\",\"type\":{\"type\":\"enum\",\"name\":\"DrugResponseClassification\",\"symbols\":[\"altered_sensitivity\",\"reduced_sensitivity\",\"increased_sensitivity\",\"altered_resistance\",\"increased_resistance\",\"reduced_resistance\",\"increased_risk_of_toxicity\",\"reduced_risk_of_toxicity\",\"altered_toxicity\",\"adverse_drug_reaction\",\"indication\",\"contraindication\",\"dosing_alteration\",\"increased_dose\",\"reduced_dose\",\"increased_monitoring\",\"increased_efficacy\",\"reduced_efficacy\",\"altered_efficacy\"]},\"doc\":\"associated effect of the drug\"}]}");
  public static org.apache.avro.Schema getClassSchema() { return SCHEMA$; }
  /** Treatment agent */
   private java.lang.String TreatmentAgent;
  /** associated effect of the drug */
   private org.gel.models.report.avro.DrugResponseClassification drugResponseClassification;

  /**
   * 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 DrugResponse() {}

  /**
   * All-args constructor.
   */
  public DrugResponse(java.lang.String TreatmentAgent, org.gel.models.report.avro.DrugResponseClassification drugResponseClassification) {
    this.TreatmentAgent = TreatmentAgent;
    this.drugResponseClassification = drugResponseClassification;
  }

  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 TreatmentAgent;
    case 1: return drugResponseClassification;
    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: TreatmentAgent = (java.lang.String)value$; break;
    case 1: drugResponseClassification = (org.gel.models.report.avro.DrugResponseClassification)value$; break;
    default: throw new org.apache.avro.AvroRuntimeException("Bad index");
    }
  }

  /**
   * Gets the value of the 'TreatmentAgent' field.
   * Treatment agent   */
  public java.lang.String getTreatmentAgent() {
    return TreatmentAgent;
  }

  /**
   * Sets the value of the 'TreatmentAgent' field.
   * Treatment agent   * @param value the value to set.
   */
  public void setTreatmentAgent(java.lang.String value) {
    this.TreatmentAgent = value;
  }

  /**
   * Gets the value of the 'drugResponseClassification' field.
   * associated effect of the drug   */
  public org.gel.models.report.avro.DrugResponseClassification getDrugResponseClassification() {
    return drugResponseClassification;
  }

  /**
   * Sets the value of the 'drugResponseClassification' field.
   * associated effect of the drug   * @param value the value to set.
   */
  public void setDrugResponseClassification(org.gel.models.report.avro.DrugResponseClassification value) {
    this.drugResponseClassification = value;
  }

  /** Creates a new DrugResponse RecordBuilder */
  public static org.gel.models.report.avro.DrugResponse.Builder newBuilder() {
    return new org.gel.models.report.avro.DrugResponse.Builder();
  }
  
  /** Creates a new DrugResponse RecordBuilder by copying an existing Builder */
  public static org.gel.models.report.avro.DrugResponse.Builder newBuilder(org.gel.models.report.avro.DrugResponse.Builder other) {
    return new org.gel.models.report.avro.DrugResponse.Builder(other);
  }
  
  /** Creates a new DrugResponse RecordBuilder by copying an existing DrugResponse instance */
  public static org.gel.models.report.avro.DrugResponse.Builder newBuilder(org.gel.models.report.avro.DrugResponse other) {
    return new org.gel.models.report.avro.DrugResponse.Builder(other);
  }
  
  /**
   * RecordBuilder for DrugResponse instances.
   */
  public static class Builder extends org.apache.avro.specific.SpecificRecordBuilderBase
    implements org.apache.avro.data.RecordBuilder {

    private java.lang.String TreatmentAgent;
    private org.gel.models.report.avro.DrugResponseClassification drugResponseClassification;

    /** Creates a new Builder */
    private Builder() {
      super(org.gel.models.report.avro.DrugResponse.SCHEMA$);
    }
    
    /** Creates a Builder by copying an existing Builder */
    private Builder(org.gel.models.report.avro.DrugResponse.Builder other) {
      super(other);
      if (isValidValue(fields()[0], other.TreatmentAgent)) {
        this.TreatmentAgent = data().deepCopy(fields()[0].schema(), other.TreatmentAgent);
        fieldSetFlags()[0] = true;
      }
      if (isValidValue(fields()[1], other.drugResponseClassification)) {
        this.drugResponseClassification = data().deepCopy(fields()[1].schema(), other.drugResponseClassification);
        fieldSetFlags()[1] = true;
      }
    }
    
    /** Creates a Builder by copying an existing DrugResponse instance */
    private Builder(org.gel.models.report.avro.DrugResponse other) {
            super(org.gel.models.report.avro.DrugResponse.SCHEMA$);
      if (isValidValue(fields()[0], other.TreatmentAgent)) {
        this.TreatmentAgent = data().deepCopy(fields()[0].schema(), other.TreatmentAgent);
        fieldSetFlags()[0] = true;
      }
      if (isValidValue(fields()[1], other.drugResponseClassification)) {
        this.drugResponseClassification = data().deepCopy(fields()[1].schema(), other.drugResponseClassification);
        fieldSetFlags()[1] = true;
      }
    }

    /** Gets the value of the 'TreatmentAgent' field */
    public java.lang.String getTreatmentAgent() {
      return TreatmentAgent;
    }
    
    /** Sets the value of the 'TreatmentAgent' field */
    public org.gel.models.report.avro.DrugResponse.Builder setTreatmentAgent(java.lang.String value) {
      validate(fields()[0], value);
      this.TreatmentAgent = value;
      fieldSetFlags()[0] = true;
      return this; 
    }
    
    /** Checks whether the 'TreatmentAgent' field has been set */
    public boolean hasTreatmentAgent() {
      return fieldSetFlags()[0];
    }
    
    /** Clears the value of the 'TreatmentAgent' field */
    public org.gel.models.report.avro.DrugResponse.Builder clearTreatmentAgent() {
      TreatmentAgent = null;
      fieldSetFlags()[0] = false;
      return this;
    }

    /** Gets the value of the 'drugResponseClassification' field */
    public org.gel.models.report.avro.DrugResponseClassification getDrugResponseClassification() {
      return drugResponseClassification;
    }
    
    /** Sets the value of the 'drugResponseClassification' field */
    public org.gel.models.report.avro.DrugResponse.Builder setDrugResponseClassification(org.gel.models.report.avro.DrugResponseClassification value) {
      validate(fields()[1], value);
      this.drugResponseClassification = value;
      fieldSetFlags()[1] = true;
      return this; 
    }
    
    /** Checks whether the 'drugResponseClassification' field has been set */
    public boolean hasDrugResponseClassification() {
      return fieldSetFlags()[1];
    }
    
    /** Clears the value of the 'drugResponseClassification' field */
    public org.gel.models.report.avro.DrugResponse.Builder clearDrugResponseClassification() {
      drugResponseClassification = null;
      fieldSetFlags()[1] = false;
      return this;
    }

    @Override
    public DrugResponse build() {
      try {
        DrugResponse record = new DrugResponse();
        record.TreatmentAgent = fieldSetFlags()[0] ? this.TreatmentAgent : (java.lang.String) defaultValue(fields()[0]);
        record.drugResponseClassification = fieldSetFlags()[1] ? this.drugResponseClassification : (org.gel.models.report.avro.DrugResponseClassification) defaultValue(fields()[1]);
        return record;
      } catch (Exception e) {
        throw new org.apache.avro.AvroRuntimeException(e);
      }
    }
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy