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

org.gel.models.report.avro.StructuralVariantDetails 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 StructuralVariantDetails 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\":\"StructuralVariantDetails\",\"namespace\":\"org.gel.models.report.avro\",\"fields\":[{\"name\":\"variantType\",\"type\":{\"type\":\"enum\",\"name\":\"StructuralVariantType\",\"symbols\":[\"ins\",\"dup\",\"inv\",\"amplification\",\"deletion\",\"dup_tandem\",\"del_me\",\"ins_me\"]},\"doc\":\"Strctural variant type\"},{\"name\":\"structuralVariantCoordinates\",\"type\":{\"type\":\"record\",\"name\":\"Coordinates\",\"fields\":[{\"name\":\"assembly\",\"type\":{\"type\":\"enum\",\"name\":\"Assembly\",\"doc\":\"The reference genome assembly\",\"symbols\":[\"GRCh38\",\"GRCh37\"]},\"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\":\"Structural variant coordinates\"},{\"name\":\"numberOfCopies\",\"type\":[\"null\",{\"type\":\"array\",\"items\":{\"type\":\"record\",\"name\":\"NumberOfCopies\",\"fields\":[{\"name\":\"numberOfCopies\",\"type\":\"int\",\"doc\":\"Number of copies given by the caller in one of the allele\"},{\"name\":\"confidenceIntervalMaximum\",\"type\":[\"null\",\"int\"]},{\"name\":\"confidenceIntervalMinimum\",\"type\":[\"null\",\"int\"]}]}}],\"doc\":\"Number of copies (required for copy number variants)\"}]}");
  public static org.apache.avro.Schema getClassSchema() { return SCHEMA$; }
  /** Strctural variant type */
   private org.gel.models.report.avro.StructuralVariantType variantType;
  /** Structural variant coordinates */
   private org.gel.models.report.avro.Coordinates structuralVariantCoordinates;
  /** Number of copies (required for copy number variants) */
   private java.util.List 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 StructuralVariantDetails() {}

  /**
   * All-args constructor.
   */
  public StructuralVariantDetails(org.gel.models.report.avro.StructuralVariantType variantType, org.gel.models.report.avro.Coordinates structuralVariantCoordinates, java.util.List numberOfCopies) {
    this.variantType = variantType;
    this.structuralVariantCoordinates = structuralVariantCoordinates;
    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 variantType;
    case 1: return structuralVariantCoordinates;
    case 2: 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: variantType = (org.gel.models.report.avro.StructuralVariantType)value$; break;
    case 1: structuralVariantCoordinates = (org.gel.models.report.avro.Coordinates)value$; break;
    case 2: numberOfCopies = (java.util.List)value$; break;
    default: throw new org.apache.avro.AvroRuntimeException("Bad index");
    }
  }

  /**
   * Gets the value of the 'variantType' field.
   * Strctural variant type   */
  public org.gel.models.report.avro.StructuralVariantType getVariantType() {
    return variantType;
  }

  /**
   * Sets the value of the 'variantType' field.
   * Strctural variant type   * @param value the value to set.
   */
  public void setVariantType(org.gel.models.report.avro.StructuralVariantType value) {
    this.variantType = value;
  }

  /**
   * Gets the value of the 'structuralVariantCoordinates' field.
   * Structural variant coordinates   */
  public org.gel.models.report.avro.Coordinates getStructuralVariantCoordinates() {
    return structuralVariantCoordinates;
  }

  /**
   * Sets the value of the 'structuralVariantCoordinates' field.
   * Structural variant coordinates   * @param value the value to set.
   */
  public void setStructuralVariantCoordinates(org.gel.models.report.avro.Coordinates value) {
    this.structuralVariantCoordinates = value;
  }

  /**
   * Gets the value of the 'numberOfCopies' field.
   * Number of copies (required for copy number variants)   */
  public java.util.List getNumberOfCopies() {
    return numberOfCopies;
  }

  /**
   * Sets the value of the 'numberOfCopies' field.
   * Number of copies (required for copy number variants)   * @param value the value to set.
   */
  public void setNumberOfCopies(java.util.List value) {
    this.numberOfCopies = value;
  }

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

    private org.gel.models.report.avro.StructuralVariantType variantType;
    private org.gel.models.report.avro.Coordinates structuralVariantCoordinates;
    private java.util.List numberOfCopies;

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

    /** Gets the value of the 'variantType' field */
    public org.gel.models.report.avro.StructuralVariantType getVariantType() {
      return variantType;
    }
    
    /** Sets the value of the 'variantType' field */
    public org.gel.models.report.avro.StructuralVariantDetails.Builder setVariantType(org.gel.models.report.avro.StructuralVariantType value) {
      validate(fields()[0], value);
      this.variantType = value;
      fieldSetFlags()[0] = true;
      return this; 
    }
    
    /** Checks whether the 'variantType' field has been set */
    public boolean hasVariantType() {
      return fieldSetFlags()[0];
    }
    
    /** Clears the value of the 'variantType' field */
    public org.gel.models.report.avro.StructuralVariantDetails.Builder clearVariantType() {
      variantType = null;
      fieldSetFlags()[0] = false;
      return this;
    }

    /** Gets the value of the 'structuralVariantCoordinates' field */
    public org.gel.models.report.avro.Coordinates getStructuralVariantCoordinates() {
      return structuralVariantCoordinates;
    }
    
    /** Sets the value of the 'structuralVariantCoordinates' field */
    public org.gel.models.report.avro.StructuralVariantDetails.Builder setStructuralVariantCoordinates(org.gel.models.report.avro.Coordinates value) {
      validate(fields()[1], value);
      this.structuralVariantCoordinates = value;
      fieldSetFlags()[1] = true;
      return this; 
    }
    
    /** Checks whether the 'structuralVariantCoordinates' field has been set */
    public boolean hasStructuralVariantCoordinates() {
      return fieldSetFlags()[1];
    }
    
    /** Clears the value of the 'structuralVariantCoordinates' field */
    public org.gel.models.report.avro.StructuralVariantDetails.Builder clearStructuralVariantCoordinates() {
      structuralVariantCoordinates = null;
      fieldSetFlags()[1] = false;
      return this;
    }

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

    @Override
    public StructuralVariantDetails build() {
      try {
        StructuralVariantDetails record = new StructuralVariantDetails();
        record.variantType = fieldSetFlags()[0] ? this.variantType : (org.gel.models.report.avro.StructuralVariantType) defaultValue(fields()[0]);
        record.structuralVariantCoordinates = fieldSetFlags()[1] ? this.structuralVariantCoordinates : (org.gel.models.report.avro.Coordinates) defaultValue(fields()[1]);
        record.numberOfCopies = fieldSetFlags()[2] ? this.numberOfCopies : (java.util.List) defaultValue(fields()[2]);
        return record;
      } catch (Exception e) {
        throw new org.apache.avro.AvroRuntimeException(e);
      }
    }
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy