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

org.gel.models.report.avro.AmpEvidence Maven / Gradle / Ivy

/**
 * Autogenerated by Avro
 * 
 * DO NOT EDIT DIRECTLY
 */
package org.gel.models.report.avro;  
@SuppressWarnings("all")
/** Evidences as defined in AMP guidelines, they are composed by a evidence type (first column in the evidence table of
    the guidlines) and a assessment of the evicence, this last one will define the streght of the evidence, supporting
    the variant to be classified as TierI-IV */
@org.apache.avro.specific.AvroGenerated
public class AmpEvidence 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\":\"AmpEvidence\",\"namespace\":\"org.gel.models.report.avro\",\"doc\":\"Evidences as defined in AMP guidelines, they are composed by a evidence type (first column in the evidence table of\\n    the guidlines) and a assessment of the evicence, this last one will define the streght of the evidence, supporting\\n    the variant to be classified as TierI-IV\",\"fields\":[{\"name\":\"type\",\"type\":{\"type\":\"enum\",\"name\":\"AmpEvidenceType\",\"doc\":\"Type of evidence in the AMP guideline\",\"symbols\":[\"mutation_type\",\"therapies\",\"variant_frequencies\",\"potential_germline\",\"population_database_presence\",\"germline_database_presence\",\"somatic_database_presence\",\"impact_predictive_software\",\"pathway_involvement\",\"publications\"]},\"doc\":\"AMP evidence type according to Guidlines, i.e germline_database_presence\"},{\"name\":\"evidenceAssessment\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"},\"doc\":\"Assessment for AMP evidence, i.e Present in ClinVar\"}]}");
  public static org.apache.avro.Schema getClassSchema() { return SCHEMA$; }
  /** AMP evidence type according to Guidlines, i.e germline_database_presence */
   private org.gel.models.report.avro.AmpEvidenceType type;
  /** Assessment for AMP evidence, i.e Present in ClinVar */
   private java.lang.String evidenceAssessment;

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

  /**
   * All-args constructor.
   */
  public AmpEvidence(org.gel.models.report.avro.AmpEvidenceType type, java.lang.String evidenceAssessment) {
    this.type = type;
    this.evidenceAssessment = evidenceAssessment;
  }

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

  /**
   * Gets the value of the 'type' field.
   * AMP evidence type according to Guidlines, i.e germline_database_presence   */
  public org.gel.models.report.avro.AmpEvidenceType getType() {
    return type;
  }

  /**
   * Sets the value of the 'type' field.
   * AMP evidence type according to Guidlines, i.e germline_database_presence   * @param value the value to set.
   */
  public void setType(org.gel.models.report.avro.AmpEvidenceType value) {
    this.type = value;
  }

  /**
   * Gets the value of the 'evidenceAssessment' field.
   * Assessment for AMP evidence, i.e Present in ClinVar   */
  public java.lang.String getEvidenceAssessment() {
    return evidenceAssessment;
  }

  /**
   * Sets the value of the 'evidenceAssessment' field.
   * Assessment for AMP evidence, i.e Present in ClinVar   * @param value the value to set.
   */
  public void setEvidenceAssessment(java.lang.String value) {
    this.evidenceAssessment = value;
  }

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

    private org.gel.models.report.avro.AmpEvidenceType type;
    private java.lang.String evidenceAssessment;

    /** Creates a new Builder */
    private Builder() {
      super(org.gel.models.report.avro.AmpEvidence.SCHEMA$);
    }
    
    /** Creates a Builder by copying an existing Builder */
    private Builder(org.gel.models.report.avro.AmpEvidence.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.evidenceAssessment)) {
        this.evidenceAssessment = data().deepCopy(fields()[1].schema(), other.evidenceAssessment);
        fieldSetFlags()[1] = true;
      }
    }
    
    /** Creates a Builder by copying an existing AmpEvidence instance */
    private Builder(org.gel.models.report.avro.AmpEvidence other) {
            super(org.gel.models.report.avro.AmpEvidence.SCHEMA$);
      if (isValidValue(fields()[0], other.type)) {
        this.type = data().deepCopy(fields()[0].schema(), other.type);
        fieldSetFlags()[0] = true;
      }
      if (isValidValue(fields()[1], other.evidenceAssessment)) {
        this.evidenceAssessment = data().deepCopy(fields()[1].schema(), other.evidenceAssessment);
        fieldSetFlags()[1] = true;
      }
    }

    /** Gets the value of the 'type' field */
    public org.gel.models.report.avro.AmpEvidenceType getType() {
      return type;
    }
    
    /** Sets the value of the 'type' field */
    public org.gel.models.report.avro.AmpEvidence.Builder setType(org.gel.models.report.avro.AmpEvidenceType 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.gel.models.report.avro.AmpEvidence.Builder clearType() {
      type = null;
      fieldSetFlags()[0] = false;
      return this;
    }

    /** Gets the value of the 'evidenceAssessment' field */
    public java.lang.String getEvidenceAssessment() {
      return evidenceAssessment;
    }
    
    /** Sets the value of the 'evidenceAssessment' field */
    public org.gel.models.report.avro.AmpEvidence.Builder setEvidenceAssessment(java.lang.String value) {
      validate(fields()[1], value);
      this.evidenceAssessment = value;
      fieldSetFlags()[1] = true;
      return this; 
    }
    
    /** Checks whether the 'evidenceAssessment' field has been set */
    public boolean hasEvidenceAssessment() {
      return fieldSetFlags()[1];
    }
    
    /** Clears the value of the 'evidenceAssessment' field */
    public org.gel.models.report.avro.AmpEvidence.Builder clearEvidenceAssessment() {
      evidenceAssessment = null;
      fieldSetFlags()[1] = false;
      return this;
    }

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy