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

org.gel.models.report.avro.Aneuploidy 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 Aneuploidy 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\":\"Aneuploidy\",\"namespace\":\"org.gel.models.report.avro\",\"fields\":[{\"name\":\"iscn\",\"type\":[\"null\",{\"type\":\"string\",\"avro.java.string\":\"String\"}],\"doc\":\"International System for Human Cytogenetic Nomenclature (.e.g: \\\"+14p+\\\", \\\"+t(13q21 q)\\\")\"},{\"name\":\"assembly\",\"type\":{\"type\":\"enum\",\"name\":\"Assembly\",\"doc\":\"The reference genome assembly\",\"symbols\":[\"GRCh38\",\"GRCh37\"]},\"doc\":\"The assembly\"},{\"name\":\"chromosome\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"},\"doc\":\"Chromosome involved in the aneuploidy\"},{\"name\":\"complete\",\"type\":\"boolean\",\"doc\":\"Wheter the aneuploidy is for the whole chromosme or just a fragment\"},{\"name\":\"coordinates\",\"type\":[\"null\",{\"type\":\"record\",\"name\":\"Coordinates\",\"fields\":[{\"name\":\"assembly\",\"type\":\"Assembly\",\"doc\":\"The assembly to which this variant corresponds\"},{\"name\":\"chromosome\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"},\"doc\":\"Chromosome without \\\"chr\\\" prefix (e.g. X rather than chrX)\"},{\"name\":\"start\",\"type\":\"int\",\"doc\":\"Start genomic position for variant (1-based)\"},{\"name\":\"end\",\"type\":\"int\",\"doc\":\"End genomic position for variant\"},{\"name\":\"ciStart\",\"type\":[\"null\",{\"type\":\"record\",\"name\":\"ConfidenceInterval\",\"fields\":[{\"name\":\"left\",\"type\":\"int\"},{\"name\":\"right\",\"type\":\"int\"}]}]},{\"name\":\"ciEnd\",\"type\":[\"null\",\"ConfidenceInterval\"]}]}],\"doc\":\"Coordinates can be specified to indicate the part of the chromosome affected\"},{\"name\":\"numberOfCopies\",\"type\":\"int\",\"doc\":\"Number of copies\"}]}");
  public static org.apache.avro.Schema getClassSchema() { return SCHEMA$; }
  /** International System for Human Cytogenetic Nomenclature (.e.g: "+14p+", "+t(13q21 q)") */
   private java.lang.String iscn;
  /** The assembly */
   private org.gel.models.report.avro.Assembly assembly;
  /** Chromosome involved in the aneuploidy */
   private java.lang.String chromosome;
  /** Wheter the aneuploidy is for the whole chromosme or just a fragment */
   private boolean complete;
  /** Coordinates can be specified to indicate the part of the chromosome affected */
   private org.gel.models.report.avro.Coordinates coordinates;
  /** Number of copies */
   private int numberOfCopies;

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

  /**
   * All-args constructor.
   */
  public Aneuploidy(java.lang.String iscn, org.gel.models.report.avro.Assembly assembly, java.lang.String chromosome, java.lang.Boolean complete, org.gel.models.report.avro.Coordinates coordinates, java.lang.Integer numberOfCopies) {
    this.iscn = iscn;
    this.assembly = assembly;
    this.chromosome = chromosome;
    this.complete = complete;
    this.coordinates = coordinates;
    this.numberOfCopies = numberOfCopies;
  }

  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 iscn;
    case 1: return assembly;
    case 2: return chromosome;
    case 3: return complete;
    case 4: return coordinates;
    case 5: return numberOfCopies;
    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: iscn = (java.lang.String)value$; break;
    case 1: assembly = (org.gel.models.report.avro.Assembly)value$; break;
    case 2: chromosome = (java.lang.String)value$; break;
    case 3: complete = (java.lang.Boolean)value$; break;
    case 4: coordinates = (org.gel.models.report.avro.Coordinates)value$; break;
    case 5: numberOfCopies = (java.lang.Integer)value$; break;
    default: throw new org.apache.avro.AvroRuntimeException("Bad index");
    }
  }

  /**
   * Gets the value of the 'iscn' field.
   * International System for Human Cytogenetic Nomenclature (.e.g: "+14p+", "+t(13q21 q)")   */
  public java.lang.String getIscn() {
    return iscn;
  }

  /**
   * Sets the value of the 'iscn' field.
   * International System for Human Cytogenetic Nomenclature (.e.g: "+14p+", "+t(13q21 q)")   * @param value the value to set.
   */
  public void setIscn(java.lang.String value) {
    this.iscn = value;
  }

  /**
   * Gets the value of the 'assembly' field.
   * The assembly   */
  public org.gel.models.report.avro.Assembly getAssembly() {
    return assembly;
  }

  /**
   * Sets the value of the 'assembly' field.
   * The assembly   * @param value the value to set.
   */
  public void setAssembly(org.gel.models.report.avro.Assembly value) {
    this.assembly = value;
  }

  /**
   * Gets the value of the 'chromosome' field.
   * Chromosome involved in the aneuploidy   */
  public java.lang.String getChromosome() {
    return chromosome;
  }

  /**
   * Sets the value of the 'chromosome' field.
   * Chromosome involved in the aneuploidy   * @param value the value to set.
   */
  public void setChromosome(java.lang.String value) {
    this.chromosome = value;
  }

  /**
   * Gets the value of the 'complete' field.
   * Wheter the aneuploidy is for the whole chromosme or just a fragment   */
  public java.lang.Boolean getComplete() {
    return complete;
  }

  /**
   * Sets the value of the 'complete' field.
   * Wheter the aneuploidy is for the whole chromosme or just a fragment   * @param value the value to set.
   */
  public void setComplete(java.lang.Boolean value) {
    this.complete = value;
  }

  /**
   * Gets the value of the 'coordinates' field.
   * Coordinates can be specified to indicate the part of the chromosome affected   */
  public org.gel.models.report.avro.Coordinates getCoordinates() {
    return coordinates;
  }

  /**
   * Sets the value of the 'coordinates' field.
   * Coordinates can be specified to indicate the part of the chromosome affected   * @param value the value to set.
   */
  public void setCoordinates(org.gel.models.report.avro.Coordinates value) {
    this.coordinates = value;
  }

  /**
   * Gets the value of the 'numberOfCopies' field.
   * Number of copies   */
  public java.lang.Integer getNumberOfCopies() {
    return numberOfCopies;
  }

  /**
   * Sets the value of the 'numberOfCopies' field.
   * Number of copies   * @param value the value to set.
   */
  public void setNumberOfCopies(java.lang.Integer value) {
    this.numberOfCopies = value;
  }

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

    private java.lang.String iscn;
    private org.gel.models.report.avro.Assembly assembly;
    private java.lang.String chromosome;
    private boolean complete;
    private org.gel.models.report.avro.Coordinates coordinates;
    private int numberOfCopies;

    /** Creates a new Builder */
    private Builder() {
      super(org.gel.models.report.avro.Aneuploidy.SCHEMA$);
    }
    
    /** Creates a Builder by copying an existing Builder */
    private Builder(org.gel.models.report.avro.Aneuploidy.Builder other) {
      super(other);
      if (isValidValue(fields()[0], other.iscn)) {
        this.iscn = data().deepCopy(fields()[0].schema(), other.iscn);
        fieldSetFlags()[0] = true;
      }
      if (isValidValue(fields()[1], other.assembly)) {
        this.assembly = data().deepCopy(fields()[1].schema(), other.assembly);
        fieldSetFlags()[1] = true;
      }
      if (isValidValue(fields()[2], other.chromosome)) {
        this.chromosome = data().deepCopy(fields()[2].schema(), other.chromosome);
        fieldSetFlags()[2] = true;
      }
      if (isValidValue(fields()[3], other.complete)) {
        this.complete = data().deepCopy(fields()[3].schema(), other.complete);
        fieldSetFlags()[3] = true;
      }
      if (isValidValue(fields()[4], other.coordinates)) {
        this.coordinates = data().deepCopy(fields()[4].schema(), other.coordinates);
        fieldSetFlags()[4] = true;
      }
      if (isValidValue(fields()[5], other.numberOfCopies)) {
        this.numberOfCopies = data().deepCopy(fields()[5].schema(), other.numberOfCopies);
        fieldSetFlags()[5] = true;
      }
    }
    
    /** Creates a Builder by copying an existing Aneuploidy instance */
    private Builder(org.gel.models.report.avro.Aneuploidy other) {
            super(org.gel.models.report.avro.Aneuploidy.SCHEMA$);
      if (isValidValue(fields()[0], other.iscn)) {
        this.iscn = data().deepCopy(fields()[0].schema(), other.iscn);
        fieldSetFlags()[0] = true;
      }
      if (isValidValue(fields()[1], other.assembly)) {
        this.assembly = data().deepCopy(fields()[1].schema(), other.assembly);
        fieldSetFlags()[1] = true;
      }
      if (isValidValue(fields()[2], other.chromosome)) {
        this.chromosome = data().deepCopy(fields()[2].schema(), other.chromosome);
        fieldSetFlags()[2] = true;
      }
      if (isValidValue(fields()[3], other.complete)) {
        this.complete = data().deepCopy(fields()[3].schema(), other.complete);
        fieldSetFlags()[3] = true;
      }
      if (isValidValue(fields()[4], other.coordinates)) {
        this.coordinates = data().deepCopy(fields()[4].schema(), other.coordinates);
        fieldSetFlags()[4] = true;
      }
      if (isValidValue(fields()[5], other.numberOfCopies)) {
        this.numberOfCopies = data().deepCopy(fields()[5].schema(), other.numberOfCopies);
        fieldSetFlags()[5] = true;
      }
    }

    /** Gets the value of the 'iscn' field */
    public java.lang.String getIscn() {
      return iscn;
    }
    
    /** Sets the value of the 'iscn' field */
    public org.gel.models.report.avro.Aneuploidy.Builder setIscn(java.lang.String value) {
      validate(fields()[0], value);
      this.iscn = value;
      fieldSetFlags()[0] = true;
      return this; 
    }
    
    /** Checks whether the 'iscn' field has been set */
    public boolean hasIscn() {
      return fieldSetFlags()[0];
    }
    
    /** Clears the value of the 'iscn' field */
    public org.gel.models.report.avro.Aneuploidy.Builder clearIscn() {
      iscn = null;
      fieldSetFlags()[0] = false;
      return this;
    }

    /** Gets the value of the 'assembly' field */
    public org.gel.models.report.avro.Assembly getAssembly() {
      return assembly;
    }
    
    /** Sets the value of the 'assembly' field */
    public org.gel.models.report.avro.Aneuploidy.Builder setAssembly(org.gel.models.report.avro.Assembly value) {
      validate(fields()[1], value);
      this.assembly = value;
      fieldSetFlags()[1] = true;
      return this; 
    }
    
    /** Checks whether the 'assembly' field has been set */
    public boolean hasAssembly() {
      return fieldSetFlags()[1];
    }
    
    /** Clears the value of the 'assembly' field */
    public org.gel.models.report.avro.Aneuploidy.Builder clearAssembly() {
      assembly = null;
      fieldSetFlags()[1] = false;
      return this;
    }

    /** Gets the value of the 'chromosome' field */
    public java.lang.String getChromosome() {
      return chromosome;
    }
    
    /** Sets the value of the 'chromosome' field */
    public org.gel.models.report.avro.Aneuploidy.Builder setChromosome(java.lang.String value) {
      validate(fields()[2], value);
      this.chromosome = value;
      fieldSetFlags()[2] = true;
      return this; 
    }
    
    /** Checks whether the 'chromosome' field has been set */
    public boolean hasChromosome() {
      return fieldSetFlags()[2];
    }
    
    /** Clears the value of the 'chromosome' field */
    public org.gel.models.report.avro.Aneuploidy.Builder clearChromosome() {
      chromosome = null;
      fieldSetFlags()[2] = false;
      return this;
    }

    /** Gets the value of the 'complete' field */
    public java.lang.Boolean getComplete() {
      return complete;
    }
    
    /** Sets the value of the 'complete' field */
    public org.gel.models.report.avro.Aneuploidy.Builder setComplete(boolean value) {
      validate(fields()[3], value);
      this.complete = value;
      fieldSetFlags()[3] = true;
      return this; 
    }
    
    /** Checks whether the 'complete' field has been set */
    public boolean hasComplete() {
      return fieldSetFlags()[3];
    }
    
    /** Clears the value of the 'complete' field */
    public org.gel.models.report.avro.Aneuploidy.Builder clearComplete() {
      fieldSetFlags()[3] = false;
      return this;
    }

    /** Gets the value of the 'coordinates' field */
    public org.gel.models.report.avro.Coordinates getCoordinates() {
      return coordinates;
    }
    
    /** Sets the value of the 'coordinates' field */
    public org.gel.models.report.avro.Aneuploidy.Builder setCoordinates(org.gel.models.report.avro.Coordinates value) {
      validate(fields()[4], value);
      this.coordinates = value;
      fieldSetFlags()[4] = true;
      return this; 
    }
    
    /** Checks whether the 'coordinates' field has been set */
    public boolean hasCoordinates() {
      return fieldSetFlags()[4];
    }
    
    /** Clears the value of the 'coordinates' field */
    public org.gel.models.report.avro.Aneuploidy.Builder clearCoordinates() {
      coordinates = null;
      fieldSetFlags()[4] = false;
      return this;
    }

    /** Gets the value of the 'numberOfCopies' field */
    public java.lang.Integer getNumberOfCopies() {
      return numberOfCopies;
    }
    
    /** Sets the value of the 'numberOfCopies' field */
    public org.gel.models.report.avro.Aneuploidy.Builder setNumberOfCopies(int value) {
      validate(fields()[5], value);
      this.numberOfCopies = value;
      fieldSetFlags()[5] = true;
      return this; 
    }
    
    /** Checks whether the 'numberOfCopies' field has been set */
    public boolean hasNumberOfCopies() {
      return fieldSetFlags()[5];
    }
    
    /** Clears the value of the 'numberOfCopies' field */
    public org.gel.models.report.avro.Aneuploidy.Builder clearNumberOfCopies() {
      fieldSetFlags()[5] = false;
      return this;
    }

    @Override
    public Aneuploidy build() {
      try {
        Aneuploidy record = new Aneuploidy();
        record.iscn = fieldSetFlags()[0] ? this.iscn : (java.lang.String) defaultValue(fields()[0]);
        record.assembly = fieldSetFlags()[1] ? this.assembly : (org.gel.models.report.avro.Assembly) defaultValue(fields()[1]);
        record.chromosome = fieldSetFlags()[2] ? this.chromosome : (java.lang.String) defaultValue(fields()[2]);
        record.complete = fieldSetFlags()[3] ? this.complete : (java.lang.Boolean) defaultValue(fields()[3]);
        record.coordinates = fieldSetFlags()[4] ? this.coordinates : (org.gel.models.report.avro.Coordinates) defaultValue(fields()[4]);
        record.numberOfCopies = fieldSetFlags()[5] ? this.numberOfCopies : (java.lang.Integer) defaultValue(fields()[5]);
        return record;
      } catch (Exception e) {
        throw new org.apache.avro.AvroRuntimeException(e);
      }
    }
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy