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

org.opencb.biodata.models.variant.avro.Breakend 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 Breakend 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\":\"Breakend\",\"namespace\":\"org.opencb.biodata.models.variant.avro\",\"fields\":[{\"name\":\"mate\",\"type\":[\"null\",{\"type\":\"record\",\"name\":\"BreakendMate\",\"fields\":[{\"name\":\"chromosome\",\"type\":[\"null\",{\"type\":\"string\",\"avro.java.string\":\"String\"}]},{\"name\":\"position\",\"type\":[\"null\",\"int\"]},{\"name\":\"ciPositionLeft\",\"type\":[\"null\",\"int\"]},{\"name\":\"ciPositionRight\",\"type\":[\"null\",\"int\"]}]}]},{\"name\":\"orientation\",\"type\":[\"null\",{\"type\":\"enum\",\"name\":\"BreakendOrientation\",\"doc\":\"* SE | (Start -> End)   | s | t[p[ | piece extending to the right of p is joined after t\\n     * SS | (Start -> Start) | s | t]p] | reverse comp piece extending left of p is joined after t\\n     * ES | (End -> Start)   | s | ]p]t | piece extending to the left of p is joined before t\\n     * EE | (End -> End)     | s | [p[t | reverse comp piece extending right of p is joined before t\",\"symbols\":[\"SE\",\"SS\",\"ES\",\"EE\"]}]},{\"name\":\"insSeq\",\"type\":[\"null\",{\"type\":\"string\",\"avro.java.string\":\"String\"}]}]}");
  public static org.apache.avro.Schema getClassSchema() { return SCHEMA$; }
   private org.opencb.biodata.models.variant.avro.BreakendMate mate;
   private org.opencb.biodata.models.variant.avro.BreakendOrientation orientation;
   private java.lang.String insSeq;

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

  /**
   * All-args constructor.
   */
  public Breakend(org.opencb.biodata.models.variant.avro.BreakendMate mate, org.opencb.biodata.models.variant.avro.BreakendOrientation orientation, java.lang.String insSeq) {
    this.mate = mate;
    this.orientation = orientation;
    this.insSeq = insSeq;
  }

  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 mate;
    case 1: return orientation;
    case 2: return insSeq;
    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: mate = (org.opencb.biodata.models.variant.avro.BreakendMate)value$; break;
    case 1: orientation = (org.opencb.biodata.models.variant.avro.BreakendOrientation)value$; break;
    case 2: insSeq = (java.lang.String)value$; break;
    default: throw new org.apache.avro.AvroRuntimeException("Bad index");
    }
  }

  /**
   * Gets the value of the 'mate' field.
   */
  public org.opencb.biodata.models.variant.avro.BreakendMate getMate() {
    return mate;
  }

  /**
   * Sets the value of the 'mate' field.
   * @param value the value to set.
   */
  public void setMate(org.opencb.biodata.models.variant.avro.BreakendMate value) {
    this.mate = value;
  }

  /**
   * Gets the value of the 'orientation' field.
   */
  public org.opencb.biodata.models.variant.avro.BreakendOrientation getOrientation() {
    return orientation;
  }

  /**
   * Sets the value of the 'orientation' field.
   * @param value the value to set.
   */
  public void setOrientation(org.opencb.biodata.models.variant.avro.BreakendOrientation value) {
    this.orientation = value;
  }

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

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

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

    private org.opencb.biodata.models.variant.avro.BreakendMate mate;
    private org.opencb.biodata.models.variant.avro.BreakendOrientation orientation;
    private java.lang.String insSeq;

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

    /** Gets the value of the 'mate' field */
    public org.opencb.biodata.models.variant.avro.BreakendMate getMate() {
      return mate;
    }
    
    /** Sets the value of the 'mate' field */
    public org.opencb.biodata.models.variant.avro.Breakend.Builder setMate(org.opencb.biodata.models.variant.avro.BreakendMate value) {
      validate(fields()[0], value);
      this.mate = value;
      fieldSetFlags()[0] = true;
      return this; 
    }
    
    /** Checks whether the 'mate' field has been set */
    public boolean hasMate() {
      return fieldSetFlags()[0];
    }
    
    /** Clears the value of the 'mate' field */
    public org.opencb.biodata.models.variant.avro.Breakend.Builder clearMate() {
      mate = null;
      fieldSetFlags()[0] = false;
      return this;
    }

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

    /** Gets the value of the 'insSeq' field */
    public java.lang.String getInsSeq() {
      return insSeq;
    }
    
    /** Sets the value of the 'insSeq' field */
    public org.opencb.biodata.models.variant.avro.Breakend.Builder setInsSeq(java.lang.String value) {
      validate(fields()[2], value);
      this.insSeq = value;
      fieldSetFlags()[2] = true;
      return this; 
    }
    
    /** Checks whether the 'insSeq' field has been set */
    public boolean hasInsSeq() {
      return fieldSetFlags()[2];
    }
    
    /** Clears the value of the 'insSeq' field */
    public org.opencb.biodata.models.variant.avro.Breakend.Builder clearInsSeq() {
      insSeq = null;
      fieldSetFlags()[2] = false;
      return this;
    }

    @Override
    public Breakend build() {
      try {
        Breakend record = new Breakend();
        record.mate = fieldSetFlags()[0] ? this.mate : (org.opencb.biodata.models.variant.avro.BreakendMate) defaultValue(fields()[0]);
        record.orientation = fieldSetFlags()[1] ? this.orientation : (org.opencb.biodata.models.variant.avro.BreakendOrientation) defaultValue(fields()[1]);
        record.insSeq = fieldSetFlags()[2] ? this.insSeq : (java.lang.String) defaultValue(fields()[2]);
        return record;
      } catch (Exception e) {
        throw new org.apache.avro.AvroRuntimeException(e);
      }
    }
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy