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

org.opencb.biodata.models.variant.avro.OriginalCall 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 OriginalCall 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\":\"OriginalCall\",\"namespace\":\"org.opencb.biodata.models.variant.avro\",\"fields\":[{\"name\":\"variantId\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"},\"doc\":\"* Original variant ID before normalization including all secondary alternates.\"},{\"name\":\"alleleIndex\",\"type\":[\"null\",\"int\"],\"doc\":\"* Alternate allele index of the original multi-allellic variant call in which was decomposed.\"}]}");
  public static org.apache.avro.Schema getClassSchema() { return SCHEMA$; }
  /** * Original variant ID before normalization including all secondary alternates. */
   private java.lang.String variantId;
  /** * Alternate allele index of the original multi-allellic variant call in which was decomposed. */
   private java.lang.Integer alleleIndex;

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

  /**
   * All-args constructor.
   */
  public OriginalCall(java.lang.String variantId, java.lang.Integer alleleIndex) {
    this.variantId = variantId;
    this.alleleIndex = alleleIndex;
  }

  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 variantId;
    case 1: return alleleIndex;
    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: variantId = (java.lang.String)value$; break;
    case 1: alleleIndex = (java.lang.Integer)value$; break;
    default: throw new org.apache.avro.AvroRuntimeException("Bad index");
    }
  }

  /**
   * Gets the value of the 'variantId' field.
   * * Original variant ID before normalization including all secondary alternates.   */
  public java.lang.String getVariantId() {
    return variantId;
  }

  /**
   * Sets the value of the 'variantId' field.
   * * Original variant ID before normalization including all secondary alternates.   * @param value the value to set.
   */
  public void setVariantId(java.lang.String value) {
    this.variantId = value;
  }

  /**
   * Gets the value of the 'alleleIndex' field.
   * * Alternate allele index of the original multi-allellic variant call in which was decomposed.   */
  public java.lang.Integer getAlleleIndex() {
    return alleleIndex;
  }

  /**
   * Sets the value of the 'alleleIndex' field.
   * * Alternate allele index of the original multi-allellic variant call in which was decomposed.   * @param value the value to set.
   */
  public void setAlleleIndex(java.lang.Integer value) {
    this.alleleIndex = value;
  }

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

    private java.lang.String variantId;
    private java.lang.Integer alleleIndex;

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

    /** Gets the value of the 'variantId' field */
    public java.lang.String getVariantId() {
      return variantId;
    }
    
    /** Sets the value of the 'variantId' field */
    public org.opencb.biodata.models.variant.avro.OriginalCall.Builder setVariantId(java.lang.String value) {
      validate(fields()[0], value);
      this.variantId = value;
      fieldSetFlags()[0] = true;
      return this; 
    }
    
    /** Checks whether the 'variantId' field has been set */
    public boolean hasVariantId() {
      return fieldSetFlags()[0];
    }
    
    /** Clears the value of the 'variantId' field */
    public org.opencb.biodata.models.variant.avro.OriginalCall.Builder clearVariantId() {
      variantId = null;
      fieldSetFlags()[0] = false;
      return this;
    }

    /** Gets the value of the 'alleleIndex' field */
    public java.lang.Integer getAlleleIndex() {
      return alleleIndex;
    }
    
    /** Sets the value of the 'alleleIndex' field */
    public org.opencb.biodata.models.variant.avro.OriginalCall.Builder setAlleleIndex(java.lang.Integer value) {
      validate(fields()[1], value);
      this.alleleIndex = value;
      fieldSetFlags()[1] = true;
      return this; 
    }
    
    /** Checks whether the 'alleleIndex' field has been set */
    public boolean hasAlleleIndex() {
      return fieldSetFlags()[1];
    }
    
    /** Clears the value of the 'alleleIndex' field */
    public org.opencb.biodata.models.variant.avro.OriginalCall.Builder clearAlleleIndex() {
      alleleIndex = null;
      fieldSetFlags()[1] = false;
      return this;
    }

    @Override
    public OriginalCall build() {
      try {
        OriginalCall record = new OriginalCall();
        record.variantId = fieldSetFlags()[0] ? this.variantId : (java.lang.String) defaultValue(fields()[0]);
        record.alleleIndex = fieldSetFlags()[1] ? this.alleleIndex : (java.lang.Integer) defaultValue(fields()[1]);
        return record;
      } catch (Exception e) {
        throw new org.apache.avro.AvroRuntimeException(e);
      }
    }
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy