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

org.opencb.biodata.models.variant.avro.FileEntry 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 FileEntry 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\":\"FileEntry\",\"namespace\":\"org.opencb.biodata.models.variant.avro\",\"fields\":[{\"name\":\"fileId\",\"type\":[\"null\",{\"type\":\"string\",\"avro.java.string\":\"String\"}],\"doc\":\"* Unique identifier of the source file.\"},{\"name\":\"call\",\"type\":[\"null\",{\"type\":\"record\",\"name\":\"OriginalCall\",\"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.\"}]}],\"doc\":\"* Original call position for the variant, if the file was normalized.\\n         *\\n         * {position}:{reference}:{alternate}(,{other_alternate})*:{allele_index}\"},{\"name\":\"data\",\"type\":{\"type\":\"map\",\"values\":{\"type\":\"string\",\"avro.java.string\":\"String\"},\"avro.java.string\":\"String\"},\"doc\":\"* Optional data that probably depend on the format of the file the\\n         * variant was initially read from.\"}]}");
  public static org.apache.avro.Schema getClassSchema() { return SCHEMA$; }
  /** * Unique identifier of the source file. */
   private java.lang.String fileId;
  /** * Original call position for the variant, if the file was normalized.
         *
         * {position}:{reference}:{alternate}(,{other_alternate})*:{allele_index} */
   private org.opencb.biodata.models.variant.avro.OriginalCall call;
  /** * Optional data that probably depend on the format of the file the
         * variant was initially read from. */
   private java.util.Map data;

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

  /**
   * All-args constructor.
   */
  public FileEntry(java.lang.String fileId, org.opencb.biodata.models.variant.avro.OriginalCall call, java.util.Map data) {
    this.fileId = fileId;
    this.call = call;
    this.data = data;
  }

  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 fileId;
    case 1: return call;
    case 2: return data;
    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: fileId = (java.lang.String)value$; break;
    case 1: call = (org.opencb.biodata.models.variant.avro.OriginalCall)value$; break;
    case 2: data = (java.util.Map)value$; break;
    default: throw new org.apache.avro.AvroRuntimeException("Bad index");
    }
  }

  /**
   * Gets the value of the 'fileId' field.
   * * Unique identifier of the source file.   */
  public java.lang.String getFileId() {
    return fileId;
  }

  /**
   * Sets the value of the 'fileId' field.
   * * Unique identifier of the source file.   * @param value the value to set.
   */
  public void setFileId(java.lang.String value) {
    this.fileId = value;
  }

  /**
   * Gets the value of the 'call' field.
   * * Original call position for the variant, if the file was normalized.
         *
         * {position}:{reference}:{alternate}(,{other_alternate})*:{allele_index}   */
  public org.opencb.biodata.models.variant.avro.OriginalCall getCall() {
    return call;
  }

  /**
   * Sets the value of the 'call' field.
   * * Original call position for the variant, if the file was normalized.
         *
         * {position}:{reference}:{alternate}(,{other_alternate})*:{allele_index}   * @param value the value to set.
   */
  public void setCall(org.opencb.biodata.models.variant.avro.OriginalCall value) {
    this.call = value;
  }

  /**
   * Gets the value of the 'data' field.
   * * Optional data that probably depend on the format of the file the
         * variant was initially read from.   */
  public java.util.Map getData() {
    return data;
  }

  /**
   * Sets the value of the 'data' field.
   * * Optional data that probably depend on the format of the file the
         * variant was initially read from.   * @param value the value to set.
   */
  public void setData(java.util.Map value) {
    this.data = value;
  }

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

    private java.lang.String fileId;
    private org.opencb.biodata.models.variant.avro.OriginalCall call;
    private java.util.Map data;

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

    /** Gets the value of the 'fileId' field */
    public java.lang.String getFileId() {
      return fileId;
    }
    
    /** Sets the value of the 'fileId' field */
    public org.opencb.biodata.models.variant.avro.FileEntry.Builder setFileId(java.lang.String value) {
      validate(fields()[0], value);
      this.fileId = value;
      fieldSetFlags()[0] = true;
      return this; 
    }
    
    /** Checks whether the 'fileId' field has been set */
    public boolean hasFileId() {
      return fieldSetFlags()[0];
    }
    
    /** Clears the value of the 'fileId' field */
    public org.opencb.biodata.models.variant.avro.FileEntry.Builder clearFileId() {
      fileId = null;
      fieldSetFlags()[0] = false;
      return this;
    }

    /** Gets the value of the 'call' field */
    public org.opencb.biodata.models.variant.avro.OriginalCall getCall() {
      return call;
    }
    
    /** Sets the value of the 'call' field */
    public org.opencb.biodata.models.variant.avro.FileEntry.Builder setCall(org.opencb.biodata.models.variant.avro.OriginalCall value) {
      validate(fields()[1], value);
      this.call = value;
      fieldSetFlags()[1] = true;
      return this; 
    }
    
    /** Checks whether the 'call' field has been set */
    public boolean hasCall() {
      return fieldSetFlags()[1];
    }
    
    /** Clears the value of the 'call' field */
    public org.opencb.biodata.models.variant.avro.FileEntry.Builder clearCall() {
      call = null;
      fieldSetFlags()[1] = false;
      return this;
    }

    /** Gets the value of the 'data' field */
    public java.util.Map getData() {
      return data;
    }
    
    /** Sets the value of the 'data' field */
    public org.opencb.biodata.models.variant.avro.FileEntry.Builder setData(java.util.Map value) {
      validate(fields()[2], value);
      this.data = value;
      fieldSetFlags()[2] = true;
      return this; 
    }
    
    /** Checks whether the 'data' field has been set */
    public boolean hasData() {
      return fieldSetFlags()[2];
    }
    
    /** Clears the value of the 'data' field */
    public org.opencb.biodata.models.variant.avro.FileEntry.Builder clearData() {
      data = null;
      fieldSetFlags()[2] = false;
      return this;
    }

    @Override
    public FileEntry build() {
      try {
        FileEntry record = new FileEntry();
        record.fileId = fieldSetFlags()[0] ? this.fileId : (java.lang.String) defaultValue(fields()[0]);
        record.call = fieldSetFlags()[1] ? this.call : (org.opencb.biodata.models.variant.avro.OriginalCall) defaultValue(fields()[1]);
        record.data = fieldSetFlags()[2] ? this.data : (java.util.Map) defaultValue(fields()[2]);
        return record;
      } catch (Exception e) {
        throw new org.apache.avro.AvroRuntimeException(e);
      }
    }
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy