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

org.gel.models.report.avro.VariantConsequence Maven / Gradle / Ivy

/**
 * Autogenerated by Avro
 * 
 * DO NOT EDIT DIRECTLY
 */
package org.gel.models.report.avro;  
@SuppressWarnings("all")
/** A variant consequence as defined by the Sequence Ontology (SO) (e.g.: id = SO:0001816 ; name = non synonymous)
    NOTE: this record is equivalent to OpenCB's `ConsequenceType`, but we want to avoid naming collisions */
@org.apache.avro.specific.AvroGenerated
public class VariantConsequence 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\":\"VariantConsequence\",\"namespace\":\"org.gel.models.report.avro\",\"doc\":\"A variant consequence as defined by the Sequence Ontology (SO) (e.g.: id = SO:0001816 ; name = non synonymous)\\n    NOTE: this record is equivalent to OpenCB's `ConsequenceType`, but we want to avoid naming collisions\",\"fields\":[{\"name\":\"id\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"},\"doc\":\"The SO term identifier (e.g.: SO:0001816)\"},{\"name\":\"name\",\"type\":[\"null\",{\"type\":\"string\",\"avro.java.string\":\"String\"}],\"doc\":\"The SO term name (e.g.: non synonymous)\"}]}");
  public static org.apache.avro.Schema getClassSchema() { return SCHEMA$; }
  /** The SO term identifier (e.g.: SO:0001816) */
   private java.lang.String id;
  /** The SO term name (e.g.: non synonymous) */
   private java.lang.String name;

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

  /**
   * All-args constructor.
   */
  public VariantConsequence(java.lang.String id, java.lang.String name) {
    this.id = id;
    this.name = name;
  }

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

  /**
   * Gets the value of the 'id' field.
   * The SO term identifier (e.g.: SO:0001816)   */
  public java.lang.String getId() {
    return id;
  }

  /**
   * Sets the value of the 'id' field.
   * The SO term identifier (e.g.: SO:0001816)   * @param value the value to set.
   */
  public void setId(java.lang.String value) {
    this.id = value;
  }

  /**
   * Gets the value of the 'name' field.
   * The SO term name (e.g.: non synonymous)   */
  public java.lang.String getName() {
    return name;
  }

  /**
   * Sets the value of the 'name' field.
   * The SO term name (e.g.: non synonymous)   * @param value the value to set.
   */
  public void setName(java.lang.String value) {
    this.name = value;
  }

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

    private java.lang.String id;
    private java.lang.String name;

    /** Creates a new Builder */
    private Builder() {
      super(org.gel.models.report.avro.VariantConsequence.SCHEMA$);
    }
    
    /** Creates a Builder by copying an existing Builder */
    private Builder(org.gel.models.report.avro.VariantConsequence.Builder other) {
      super(other);
      if (isValidValue(fields()[0], other.id)) {
        this.id = data().deepCopy(fields()[0].schema(), other.id);
        fieldSetFlags()[0] = true;
      }
      if (isValidValue(fields()[1], other.name)) {
        this.name = data().deepCopy(fields()[1].schema(), other.name);
        fieldSetFlags()[1] = true;
      }
    }
    
    /** Creates a Builder by copying an existing VariantConsequence instance */
    private Builder(org.gel.models.report.avro.VariantConsequence other) {
            super(org.gel.models.report.avro.VariantConsequence.SCHEMA$);
      if (isValidValue(fields()[0], other.id)) {
        this.id = data().deepCopy(fields()[0].schema(), other.id);
        fieldSetFlags()[0] = true;
      }
      if (isValidValue(fields()[1], other.name)) {
        this.name = data().deepCopy(fields()[1].schema(), other.name);
        fieldSetFlags()[1] = true;
      }
    }

    /** Gets the value of the 'id' field */
    public java.lang.String getId() {
      return id;
    }
    
    /** Sets the value of the 'id' field */
    public org.gel.models.report.avro.VariantConsequence.Builder setId(java.lang.String value) {
      validate(fields()[0], value);
      this.id = value;
      fieldSetFlags()[0] = true;
      return this; 
    }
    
    /** Checks whether the 'id' field has been set */
    public boolean hasId() {
      return fieldSetFlags()[0];
    }
    
    /** Clears the value of the 'id' field */
    public org.gel.models.report.avro.VariantConsequence.Builder clearId() {
      id = null;
      fieldSetFlags()[0] = false;
      return this;
    }

    /** Gets the value of the 'name' field */
    public java.lang.String getName() {
      return name;
    }
    
    /** Sets the value of the 'name' field */
    public org.gel.models.report.avro.VariantConsequence.Builder setName(java.lang.String value) {
      validate(fields()[1], value);
      this.name = value;
      fieldSetFlags()[1] = true;
      return this; 
    }
    
    /** Checks whether the 'name' field has been set */
    public boolean hasName() {
      return fieldSetFlags()[1];
    }
    
    /** Clears the value of the 'name' field */
    public org.gel.models.report.avro.VariantConsequence.Builder clearName() {
      name = null;
      fieldSetFlags()[1] = false;
      return this;
    }

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy