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

org.opencb.biodata.models.variant.avro.GwasAssociationStudyTrait Maven / Gradle / Ivy

The newest version!
/**
 * Autogenerated by Avro
 * 
 * DO NOT EDIT DIRECTLY
 */
package org.opencb.biodata.models.variant.avro;  
@SuppressWarnings("all")
@org.apache.avro.specific.AvroGenerated
public class GwasAssociationStudyTrait 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\":\"GwasAssociationStudyTrait\",\"namespace\":\"org.opencb.biodata.models.variant.avro\",\"fields\":[{\"name\":\"diseaseTrait\",\"type\":[\"null\",{\"type\":\"string\",\"avro.java.string\":\"String\"}]},{\"name\":\"strongestSnpRiskAllele\",\"type\":[\"null\",{\"type\":\"array\",\"items\":{\"type\":\"string\",\"avro.java.string\":\"String\"}}]},{\"name\":\"ontologies\",\"type\":[\"null\",{\"type\":\"array\",\"items\":{\"type\":\"record\",\"name\":\"OntologyTermAnnotation\",\"fields\":[{\"name\":\"id\",\"type\":[\"null\",{\"type\":\"string\",\"avro.java.string\":\"String\"}]},{\"name\":\"name\",\"type\":[\"null\",{\"type\":\"string\",\"avro.java.string\":\"String\"}]},{\"name\":\"description\",\"type\":[\"null\",{\"type\":\"string\",\"avro.java.string\":\"String\"}]},{\"name\":\"source\",\"type\":[\"null\",{\"type\":\"string\",\"avro.java.string\":\"String\"}]},{\"name\":\"url\",\"type\":[\"null\",{\"type\":\"string\",\"avro.java.string\":\"String\"}]},{\"name\":\"attributes\",\"type\":[\"null\",{\"type\":\"map\",\"values\":{\"type\":\"string\",\"avro.java.string\":\"String\"},\"avro.java.string\":\"String\"}]}]}}]},{\"name\":\"scores\",\"type\":[\"null\",{\"type\":\"array\",\"items\":{\"type\":\"record\",\"name\":\"GwasAssociationStudyTraitScores\",\"fields\":[{\"name\":\"pValue\",\"type\":[\"null\",\"double\"]},{\"name\":\"pValueMlog\",\"type\":[\"null\",\"double\"]},{\"name\":\"pValueText\",\"type\":[\"null\",{\"type\":\"string\",\"avro.java.string\":\"String\"}]},{\"name\":\"orBeta\",\"type\":[\"null\",\"double\"]},{\"name\":\"percentCI\",\"type\":[\"null\",{\"type\":\"string\",\"avro.java.string\":\"String\"}]}]}}]}]}");
  public static org.apache.avro.Schema getClassSchema() { return SCHEMA$; }
   private java.lang.String diseaseTrait;
   private java.util.List strongestSnpRiskAllele;
   private java.util.List ontologies;
   private java.util.List scores;

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

  /**
   * All-args constructor.
   */
  public GwasAssociationStudyTrait(java.lang.String diseaseTrait, java.util.List strongestSnpRiskAllele, java.util.List ontologies, java.util.List scores) {
    this.diseaseTrait = diseaseTrait;
    this.strongestSnpRiskAllele = strongestSnpRiskAllele;
    this.ontologies = ontologies;
    this.scores = scores;
  }

  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 diseaseTrait;
    case 1: return strongestSnpRiskAllele;
    case 2: return ontologies;
    case 3: return scores;
    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: diseaseTrait = (java.lang.String)value$; break;
    case 1: strongestSnpRiskAllele = (java.util.List)value$; break;
    case 2: ontologies = (java.util.List)value$; break;
    case 3: scores = (java.util.List)value$; break;
    default: throw new org.apache.avro.AvroRuntimeException("Bad index");
    }
  }

  /**
   * Gets the value of the 'diseaseTrait' field.
   */
  public java.lang.String getDiseaseTrait() {
    return diseaseTrait;
  }

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

  /**
   * Gets the value of the 'strongestSnpRiskAllele' field.
   */
  public java.util.List getStrongestSnpRiskAllele() {
    return strongestSnpRiskAllele;
  }

  /**
   * Sets the value of the 'strongestSnpRiskAllele' field.
   * @param value the value to set.
   */
  public void setStrongestSnpRiskAllele(java.util.List value) {
    this.strongestSnpRiskAllele = value;
  }

  /**
   * Gets the value of the 'ontologies' field.
   */
  public java.util.List getOntologies() {
    return ontologies;
  }

  /**
   * Sets the value of the 'ontologies' field.
   * @param value the value to set.
   */
  public void setOntologies(java.util.List value) {
    this.ontologies = value;
  }

  /**
   * Gets the value of the 'scores' field.
   */
  public java.util.List getScores() {
    return scores;
  }

  /**
   * Sets the value of the 'scores' field.
   * @param value the value to set.
   */
  public void setScores(java.util.List value) {
    this.scores = value;
  }

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

    private java.lang.String diseaseTrait;
    private java.util.List strongestSnpRiskAllele;
    private java.util.List ontologies;
    private java.util.List scores;

    /** Creates a new Builder */
    private Builder() {
      super(org.opencb.biodata.models.variant.avro.GwasAssociationStudyTrait.SCHEMA$);
    }
    
    /** Creates a Builder by copying an existing Builder */
    private Builder(org.opencb.biodata.models.variant.avro.GwasAssociationStudyTrait.Builder other) {
      super(other);
      if (isValidValue(fields()[0], other.diseaseTrait)) {
        this.diseaseTrait = data().deepCopy(fields()[0].schema(), other.diseaseTrait);
        fieldSetFlags()[0] = true;
      }
      if (isValidValue(fields()[1], other.strongestSnpRiskAllele)) {
        this.strongestSnpRiskAllele = data().deepCopy(fields()[1].schema(), other.strongestSnpRiskAllele);
        fieldSetFlags()[1] = true;
      }
      if (isValidValue(fields()[2], other.ontologies)) {
        this.ontologies = data().deepCopy(fields()[2].schema(), other.ontologies);
        fieldSetFlags()[2] = true;
      }
      if (isValidValue(fields()[3], other.scores)) {
        this.scores = data().deepCopy(fields()[3].schema(), other.scores);
        fieldSetFlags()[3] = true;
      }
    }
    
    /** Creates a Builder by copying an existing GwasAssociationStudyTrait instance */
    private Builder(org.opencb.biodata.models.variant.avro.GwasAssociationStudyTrait other) {
            super(org.opencb.biodata.models.variant.avro.GwasAssociationStudyTrait.SCHEMA$);
      if (isValidValue(fields()[0], other.diseaseTrait)) {
        this.diseaseTrait = data().deepCopy(fields()[0].schema(), other.diseaseTrait);
        fieldSetFlags()[0] = true;
      }
      if (isValidValue(fields()[1], other.strongestSnpRiskAllele)) {
        this.strongestSnpRiskAllele = data().deepCopy(fields()[1].schema(), other.strongestSnpRiskAllele);
        fieldSetFlags()[1] = true;
      }
      if (isValidValue(fields()[2], other.ontologies)) {
        this.ontologies = data().deepCopy(fields()[2].schema(), other.ontologies);
        fieldSetFlags()[2] = true;
      }
      if (isValidValue(fields()[3], other.scores)) {
        this.scores = data().deepCopy(fields()[3].schema(), other.scores);
        fieldSetFlags()[3] = true;
      }
    }

    /** Gets the value of the 'diseaseTrait' field */
    public java.lang.String getDiseaseTrait() {
      return diseaseTrait;
    }
    
    /** Sets the value of the 'diseaseTrait' field */
    public org.opencb.biodata.models.variant.avro.GwasAssociationStudyTrait.Builder setDiseaseTrait(java.lang.String value) {
      validate(fields()[0], value);
      this.diseaseTrait = value;
      fieldSetFlags()[0] = true;
      return this; 
    }
    
    /** Checks whether the 'diseaseTrait' field has been set */
    public boolean hasDiseaseTrait() {
      return fieldSetFlags()[0];
    }
    
    /** Clears the value of the 'diseaseTrait' field */
    public org.opencb.biodata.models.variant.avro.GwasAssociationStudyTrait.Builder clearDiseaseTrait() {
      diseaseTrait = null;
      fieldSetFlags()[0] = false;
      return this;
    }

    /** Gets the value of the 'strongestSnpRiskAllele' field */
    public java.util.List getStrongestSnpRiskAllele() {
      return strongestSnpRiskAllele;
    }
    
    /** Sets the value of the 'strongestSnpRiskAllele' field */
    public org.opencb.biodata.models.variant.avro.GwasAssociationStudyTrait.Builder setStrongestSnpRiskAllele(java.util.List value) {
      validate(fields()[1], value);
      this.strongestSnpRiskAllele = value;
      fieldSetFlags()[1] = true;
      return this; 
    }
    
    /** Checks whether the 'strongestSnpRiskAllele' field has been set */
    public boolean hasStrongestSnpRiskAllele() {
      return fieldSetFlags()[1];
    }
    
    /** Clears the value of the 'strongestSnpRiskAllele' field */
    public org.opencb.biodata.models.variant.avro.GwasAssociationStudyTrait.Builder clearStrongestSnpRiskAllele() {
      strongestSnpRiskAllele = null;
      fieldSetFlags()[1] = false;
      return this;
    }

    /** Gets the value of the 'ontologies' field */
    public java.util.List getOntologies() {
      return ontologies;
    }
    
    /** Sets the value of the 'ontologies' field */
    public org.opencb.biodata.models.variant.avro.GwasAssociationStudyTrait.Builder setOntologies(java.util.List value) {
      validate(fields()[2], value);
      this.ontologies = value;
      fieldSetFlags()[2] = true;
      return this; 
    }
    
    /** Checks whether the 'ontologies' field has been set */
    public boolean hasOntologies() {
      return fieldSetFlags()[2];
    }
    
    /** Clears the value of the 'ontologies' field */
    public org.opencb.biodata.models.variant.avro.GwasAssociationStudyTrait.Builder clearOntologies() {
      ontologies = null;
      fieldSetFlags()[2] = false;
      return this;
    }

    /** Gets the value of the 'scores' field */
    public java.util.List getScores() {
      return scores;
    }
    
    /** Sets the value of the 'scores' field */
    public org.opencb.biodata.models.variant.avro.GwasAssociationStudyTrait.Builder setScores(java.util.List value) {
      validate(fields()[3], value);
      this.scores = value;
      fieldSetFlags()[3] = true;
      return this; 
    }
    
    /** Checks whether the 'scores' field has been set */
    public boolean hasScores() {
      return fieldSetFlags()[3];
    }
    
    /** Clears the value of the 'scores' field */
    public org.opencb.biodata.models.variant.avro.GwasAssociationStudyTrait.Builder clearScores() {
      scores = null;
      fieldSetFlags()[3] = false;
      return this;
    }

    @Override
    public GwasAssociationStudyTrait build() {
      try {
        GwasAssociationStudyTrait record = new GwasAssociationStudyTrait();
        record.diseaseTrait = fieldSetFlags()[0] ? this.diseaseTrait : (java.lang.String) defaultValue(fields()[0]);
        record.strongestSnpRiskAllele = fieldSetFlags()[1] ? this.strongestSnpRiskAllele : (java.util.List) defaultValue(fields()[1]);
        record.ontologies = fieldSetFlags()[2] ? this.ontologies : (java.util.List) defaultValue(fields()[2]);
        record.scores = fieldSetFlags()[3] ? this.scores : (java.util.List) defaultValue(fields()[3]);
        return record;
      } catch (Exception e) {
        throw new org.apache.avro.AvroRuntimeException(e);
      }
    }
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy