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

org.opencb.biodata.models.variant.avro.SampleEntry 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 SampleEntry 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\":\"SampleEntry\",\"namespace\":\"org.opencb.biodata.models.variant.avro\",\"fields\":[{\"name\":\"sampleId\",\"type\":[\"null\",{\"type\":\"string\",\"avro.java.string\":\"String\"}]},{\"name\":\"fileIndex\",\"type\":[\"null\",\"int\"]},{\"name\":\"data\",\"type\":{\"type\":\"array\",\"items\":{\"type\":\"string\",\"avro.java.string\":\"String\"}}}]}");
  public static org.apache.avro.Schema getClassSchema() { return SCHEMA$; }
   private java.lang.String sampleId;
   private java.lang.Integer fileIndex;
   private java.util.List 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 SampleEntry() {}

  /**
   * All-args constructor.
   */
  public SampleEntry(java.lang.String sampleId, java.lang.Integer fileIndex, java.util.List data) {
    this.sampleId = sampleId;
    this.fileIndex = fileIndex;
    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 sampleId;
    case 1: return fileIndex;
    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: sampleId = (java.lang.String)value$; break;
    case 1: fileIndex = (java.lang.Integer)value$; break;
    case 2: data = (java.util.List)value$; break;
    default: throw new org.apache.avro.AvroRuntimeException("Bad index");
    }
  }

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

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

  /**
   * Gets the value of the 'fileIndex' field.
   */
  public java.lang.Integer getFileIndex() {
    return fileIndex;
  }

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

  /**
   * Gets the value of the 'data' field.
   */
  public java.util.List getData() {
    return data;
  }

  /**
   * Sets the value of the 'data' field.
   * @param value the value to set.
   */
  public void setData(java.util.List value) {
    this.data = value;
  }

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

    private java.lang.String sampleId;
    private java.lang.Integer fileIndex;
    private java.util.List data;

    /** Creates a new Builder */
    private Builder() {
      super(org.opencb.biodata.models.variant.avro.SampleEntry.SCHEMA$);
    }
    
    /** Creates a Builder by copying an existing Builder */
    private Builder(org.opencb.biodata.models.variant.avro.SampleEntry.Builder other) {
      super(other);
      if (isValidValue(fields()[0], other.sampleId)) {
        this.sampleId = data().deepCopy(fields()[0].schema(), other.sampleId);
        fieldSetFlags()[0] = true;
      }
      if (isValidValue(fields()[1], other.fileIndex)) {
        this.fileIndex = data().deepCopy(fields()[1].schema(), other.fileIndex);
        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 SampleEntry instance */
    private Builder(org.opencb.biodata.models.variant.avro.SampleEntry other) {
            super(org.opencb.biodata.models.variant.avro.SampleEntry.SCHEMA$);
      if (isValidValue(fields()[0], other.sampleId)) {
        this.sampleId = data().deepCopy(fields()[0].schema(), other.sampleId);
        fieldSetFlags()[0] = true;
      }
      if (isValidValue(fields()[1], other.fileIndex)) {
        this.fileIndex = data().deepCopy(fields()[1].schema(), other.fileIndex);
        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 'sampleId' field */
    public java.lang.String getSampleId() {
      return sampleId;
    }
    
    /** Sets the value of the 'sampleId' field */
    public org.opencb.biodata.models.variant.avro.SampleEntry.Builder setSampleId(java.lang.String value) {
      validate(fields()[0], value);
      this.sampleId = value;
      fieldSetFlags()[0] = true;
      return this; 
    }
    
    /** Checks whether the 'sampleId' field has been set */
    public boolean hasSampleId() {
      return fieldSetFlags()[0];
    }
    
    /** Clears the value of the 'sampleId' field */
    public org.opencb.biodata.models.variant.avro.SampleEntry.Builder clearSampleId() {
      sampleId = null;
      fieldSetFlags()[0] = false;
      return this;
    }

    /** Gets the value of the 'fileIndex' field */
    public java.lang.Integer getFileIndex() {
      return fileIndex;
    }
    
    /** Sets the value of the 'fileIndex' field */
    public org.opencb.biodata.models.variant.avro.SampleEntry.Builder setFileIndex(java.lang.Integer value) {
      validate(fields()[1], value);
      this.fileIndex = value;
      fieldSetFlags()[1] = true;
      return this; 
    }
    
    /** Checks whether the 'fileIndex' field has been set */
    public boolean hasFileIndex() {
      return fieldSetFlags()[1];
    }
    
    /** Clears the value of the 'fileIndex' field */
    public org.opencb.biodata.models.variant.avro.SampleEntry.Builder clearFileIndex() {
      fileIndex = null;
      fieldSetFlags()[1] = false;
      return this;
    }

    /** Gets the value of the 'data' field */
    public java.util.List getData() {
      return data;
    }
    
    /** Sets the value of the 'data' field */
    public org.opencb.biodata.models.variant.avro.SampleEntry.Builder setData(java.util.List 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.SampleEntry.Builder clearData() {
      data = null;
      fieldSetFlags()[2] = false;
      return this;
    }

    @Override
    public SampleEntry build() {
      try {
        SampleEntry record = new SampleEntry();
        record.sampleId = fieldSetFlags()[0] ? this.sampleId : (java.lang.String) defaultValue(fields()[0]);
        record.fileIndex = fieldSetFlags()[1] ? this.fileIndex : (java.lang.Integer) defaultValue(fields()[1]);
        record.data = fieldSetFlags()[2] ? this.data : (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