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

org.gel.models.report.avro.Rearrangement 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 Rearrangement 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\":\"Rearrangement\",\"namespace\":\"org.gel.models.report.avro\",\"fields\":[{\"name\":\"leftCoordinates\",\"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\"]}]}},{\"name\":\"rightCoordinates\",\"type\":\"Coordinates\"},{\"name\":\"orientation\",\"type\":{\"type\":\"enum\",\"name\":\"Orientation\",\"symbols\":[\"start_start\",\"start_end\",\"end_end\"]}},{\"name\":\"leftInsSeq\",\"type\":[\"null\",{\"type\":\"string\",\"avro.java.string\":\"String\"}]},{\"name\":\"rightInsSeq\",\"type\":[\"null\",{\"type\":\"string\",\"avro.java.string\":\"String\"}]}]}");
  public static org.apache.avro.Schema getClassSchema() { return SCHEMA$; }
   private org.gel.models.report.avro.Coordinates leftCoordinates;
   private org.gel.models.report.avro.Coordinates rightCoordinates;
   private org.gel.models.report.avro.Orientation orientation;
   private java.lang.String leftInsSeq;
   private java.lang.String rightInsSeq;

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

  /**
   * All-args constructor.
   */
  public Rearrangement(org.gel.models.report.avro.Coordinates leftCoordinates, org.gel.models.report.avro.Coordinates rightCoordinates, org.gel.models.report.avro.Orientation orientation, java.lang.String leftInsSeq, java.lang.String rightInsSeq) {
    this.leftCoordinates = leftCoordinates;
    this.rightCoordinates = rightCoordinates;
    this.orientation = orientation;
    this.leftInsSeq = leftInsSeq;
    this.rightInsSeq = rightInsSeq;
  }

  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 leftCoordinates;
    case 1: return rightCoordinates;
    case 2: return orientation;
    case 3: return leftInsSeq;
    case 4: return rightInsSeq;
    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: leftCoordinates = (org.gel.models.report.avro.Coordinates)value$; break;
    case 1: rightCoordinates = (org.gel.models.report.avro.Coordinates)value$; break;
    case 2: orientation = (org.gel.models.report.avro.Orientation)value$; break;
    case 3: leftInsSeq = (java.lang.String)value$; break;
    case 4: rightInsSeq = (java.lang.String)value$; break;
    default: throw new org.apache.avro.AvroRuntimeException("Bad index");
    }
  }

  /**
   * Gets the value of the 'leftCoordinates' field.
   */
  public org.gel.models.report.avro.Coordinates getLeftCoordinates() {
    return leftCoordinates;
  }

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

  /**
   * Gets the value of the 'rightCoordinates' field.
   */
  public org.gel.models.report.avro.Coordinates getRightCoordinates() {
    return rightCoordinates;
  }

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

  /**
   * Gets the value of the 'orientation' field.
   */
  public org.gel.models.report.avro.Orientation getOrientation() {
    return orientation;
  }

  /**
   * Sets the value of the 'orientation' field.
   * @param value the value to set.
   */
  public void setOrientation(org.gel.models.report.avro.Orientation value) {
    this.orientation = value;
  }

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

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

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

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

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

    private org.gel.models.report.avro.Coordinates leftCoordinates;
    private org.gel.models.report.avro.Coordinates rightCoordinates;
    private org.gel.models.report.avro.Orientation orientation;
    private java.lang.String leftInsSeq;
    private java.lang.String rightInsSeq;

    /** Creates a new Builder */
    private Builder() {
      super(org.gel.models.report.avro.Rearrangement.SCHEMA$);
    }
    
    /** Creates a Builder by copying an existing Builder */
    private Builder(org.gel.models.report.avro.Rearrangement.Builder other) {
      super(other);
      if (isValidValue(fields()[0], other.leftCoordinates)) {
        this.leftCoordinates = data().deepCopy(fields()[0].schema(), other.leftCoordinates);
        fieldSetFlags()[0] = true;
      }
      if (isValidValue(fields()[1], other.rightCoordinates)) {
        this.rightCoordinates = data().deepCopy(fields()[1].schema(), other.rightCoordinates);
        fieldSetFlags()[1] = true;
      }
      if (isValidValue(fields()[2], other.orientation)) {
        this.orientation = data().deepCopy(fields()[2].schema(), other.orientation);
        fieldSetFlags()[2] = true;
      }
      if (isValidValue(fields()[3], other.leftInsSeq)) {
        this.leftInsSeq = data().deepCopy(fields()[3].schema(), other.leftInsSeq);
        fieldSetFlags()[3] = true;
      }
      if (isValidValue(fields()[4], other.rightInsSeq)) {
        this.rightInsSeq = data().deepCopy(fields()[4].schema(), other.rightInsSeq);
        fieldSetFlags()[4] = true;
      }
    }
    
    /** Creates a Builder by copying an existing Rearrangement instance */
    private Builder(org.gel.models.report.avro.Rearrangement other) {
            super(org.gel.models.report.avro.Rearrangement.SCHEMA$);
      if (isValidValue(fields()[0], other.leftCoordinates)) {
        this.leftCoordinates = data().deepCopy(fields()[0].schema(), other.leftCoordinates);
        fieldSetFlags()[0] = true;
      }
      if (isValidValue(fields()[1], other.rightCoordinates)) {
        this.rightCoordinates = data().deepCopy(fields()[1].schema(), other.rightCoordinates);
        fieldSetFlags()[1] = true;
      }
      if (isValidValue(fields()[2], other.orientation)) {
        this.orientation = data().deepCopy(fields()[2].schema(), other.orientation);
        fieldSetFlags()[2] = true;
      }
      if (isValidValue(fields()[3], other.leftInsSeq)) {
        this.leftInsSeq = data().deepCopy(fields()[3].schema(), other.leftInsSeq);
        fieldSetFlags()[3] = true;
      }
      if (isValidValue(fields()[4], other.rightInsSeq)) {
        this.rightInsSeq = data().deepCopy(fields()[4].schema(), other.rightInsSeq);
        fieldSetFlags()[4] = true;
      }
    }

    /** Gets the value of the 'leftCoordinates' field */
    public org.gel.models.report.avro.Coordinates getLeftCoordinates() {
      return leftCoordinates;
    }
    
    /** Sets the value of the 'leftCoordinates' field */
    public org.gel.models.report.avro.Rearrangement.Builder setLeftCoordinates(org.gel.models.report.avro.Coordinates value) {
      validate(fields()[0], value);
      this.leftCoordinates = value;
      fieldSetFlags()[0] = true;
      return this; 
    }
    
    /** Checks whether the 'leftCoordinates' field has been set */
    public boolean hasLeftCoordinates() {
      return fieldSetFlags()[0];
    }
    
    /** Clears the value of the 'leftCoordinates' field */
    public org.gel.models.report.avro.Rearrangement.Builder clearLeftCoordinates() {
      leftCoordinates = null;
      fieldSetFlags()[0] = false;
      return this;
    }

    /** Gets the value of the 'rightCoordinates' field */
    public org.gel.models.report.avro.Coordinates getRightCoordinates() {
      return rightCoordinates;
    }
    
    /** Sets the value of the 'rightCoordinates' field */
    public org.gel.models.report.avro.Rearrangement.Builder setRightCoordinates(org.gel.models.report.avro.Coordinates value) {
      validate(fields()[1], value);
      this.rightCoordinates = value;
      fieldSetFlags()[1] = true;
      return this; 
    }
    
    /** Checks whether the 'rightCoordinates' field has been set */
    public boolean hasRightCoordinates() {
      return fieldSetFlags()[1];
    }
    
    /** Clears the value of the 'rightCoordinates' field */
    public org.gel.models.report.avro.Rearrangement.Builder clearRightCoordinates() {
      rightCoordinates = null;
      fieldSetFlags()[1] = false;
      return this;
    }

    /** Gets the value of the 'orientation' field */
    public org.gel.models.report.avro.Orientation getOrientation() {
      return orientation;
    }
    
    /** Sets the value of the 'orientation' field */
    public org.gel.models.report.avro.Rearrangement.Builder setOrientation(org.gel.models.report.avro.Orientation value) {
      validate(fields()[2], value);
      this.orientation = value;
      fieldSetFlags()[2] = true;
      return this; 
    }
    
    /** Checks whether the 'orientation' field has been set */
    public boolean hasOrientation() {
      return fieldSetFlags()[2];
    }
    
    /** Clears the value of the 'orientation' field */
    public org.gel.models.report.avro.Rearrangement.Builder clearOrientation() {
      orientation = null;
      fieldSetFlags()[2] = false;
      return this;
    }

    /** Gets the value of the 'leftInsSeq' field */
    public java.lang.String getLeftInsSeq() {
      return leftInsSeq;
    }
    
    /** Sets the value of the 'leftInsSeq' field */
    public org.gel.models.report.avro.Rearrangement.Builder setLeftInsSeq(java.lang.String value) {
      validate(fields()[3], value);
      this.leftInsSeq = value;
      fieldSetFlags()[3] = true;
      return this; 
    }
    
    /** Checks whether the 'leftInsSeq' field has been set */
    public boolean hasLeftInsSeq() {
      return fieldSetFlags()[3];
    }
    
    /** Clears the value of the 'leftInsSeq' field */
    public org.gel.models.report.avro.Rearrangement.Builder clearLeftInsSeq() {
      leftInsSeq = null;
      fieldSetFlags()[3] = false;
      return this;
    }

    /** Gets the value of the 'rightInsSeq' field */
    public java.lang.String getRightInsSeq() {
      return rightInsSeq;
    }
    
    /** Sets the value of the 'rightInsSeq' field */
    public org.gel.models.report.avro.Rearrangement.Builder setRightInsSeq(java.lang.String value) {
      validate(fields()[4], value);
      this.rightInsSeq = value;
      fieldSetFlags()[4] = true;
      return this; 
    }
    
    /** Checks whether the 'rightInsSeq' field has been set */
    public boolean hasRightInsSeq() {
      return fieldSetFlags()[4];
    }
    
    /** Clears the value of the 'rightInsSeq' field */
    public org.gel.models.report.avro.Rearrangement.Builder clearRightInsSeq() {
      rightInsSeq = null;
      fieldSetFlags()[4] = false;
      return this;
    }

    @Override
    public Rearrangement build() {
      try {
        Rearrangement record = new Rearrangement();
        record.leftCoordinates = fieldSetFlags()[0] ? this.leftCoordinates : (org.gel.models.report.avro.Coordinates) defaultValue(fields()[0]);
        record.rightCoordinates = fieldSetFlags()[1] ? this.rightCoordinates : (org.gel.models.report.avro.Coordinates) defaultValue(fields()[1]);
        record.orientation = fieldSetFlags()[2] ? this.orientation : (org.gel.models.report.avro.Orientation) defaultValue(fields()[2]);
        record.leftInsSeq = fieldSetFlags()[3] ? this.leftInsSeq : (java.lang.String) defaultValue(fields()[3]);
        record.rightInsSeq = fieldSetFlags()[4] ? this.rightInsSeq : (java.lang.String) defaultValue(fields()[4]);
        return record;
      } catch (Exception e) {
        throw new org.apache.avro.AvroRuntimeException(e);
      }
    }
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy