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

org.opencb.biodata.models.metadata.Program Maven / Gradle / Ivy

The newest version!
/**
 * Autogenerated by Avro
 * 
 * DO NOT EDIT DIRECTLY
 */
package org.opencb.biodata.models.metadata;  
@SuppressWarnings("all")
@org.apache.avro.specific.AvroGenerated
public class Program 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\":\"Program\",\"namespace\":\"org.opencb.biodata.models.metadata\",\"fields\":[{\"name\":\"name\",\"type\":[\"null\",{\"type\":\"string\",\"avro.java.string\":\"String\"}],\"default\":null},{\"name\":\"version\",\"type\":[\"null\",{\"type\":\"string\",\"avro.java.string\":\"String\"}],\"default\":null},{\"name\":\"commandLine\",\"type\":[\"null\",{\"type\":\"string\",\"avro.java.string\":\"String\"}],\"default\":null},{\"name\":\"url\",\"type\":[\"null\",{\"type\":\"string\",\"avro.java.string\":\"String\"}],\"default\":null},{\"name\":\"commit\",\"type\":[\"null\",{\"type\":\"string\",\"avro.java.string\":\"String\"}],\"default\":null}]}");
  public static org.apache.avro.Schema getClassSchema() { return SCHEMA$; }
   private java.lang.String name;
   private java.lang.String version;
   private java.lang.String commandLine;
   private java.lang.String url;
   private java.lang.String commit;

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

  /**
   * All-args constructor.
   */
  public Program(java.lang.String name, java.lang.String version, java.lang.String commandLine, java.lang.String url, java.lang.String commit) {
    this.name = name;
    this.version = version;
    this.commandLine = commandLine;
    this.url = url;
    this.commit = commit;
  }

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

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

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

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

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

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

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

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

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

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

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

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

    private java.lang.String name;
    private java.lang.String version;
    private java.lang.String commandLine;
    private java.lang.String url;
    private java.lang.String commit;

    /** Creates a new Builder */
    private Builder() {
      super(org.opencb.biodata.models.metadata.Program.SCHEMA$);
    }
    
    /** Creates a Builder by copying an existing Builder */
    private Builder(org.opencb.biodata.models.metadata.Program.Builder other) {
      super(other);
      if (isValidValue(fields()[0], other.name)) {
        this.name = data().deepCopy(fields()[0].schema(), other.name);
        fieldSetFlags()[0] = true;
      }
      if (isValidValue(fields()[1], other.version)) {
        this.version = data().deepCopy(fields()[1].schema(), other.version);
        fieldSetFlags()[1] = true;
      }
      if (isValidValue(fields()[2], other.commandLine)) {
        this.commandLine = data().deepCopy(fields()[2].schema(), other.commandLine);
        fieldSetFlags()[2] = true;
      }
      if (isValidValue(fields()[3], other.url)) {
        this.url = data().deepCopy(fields()[3].schema(), other.url);
        fieldSetFlags()[3] = true;
      }
      if (isValidValue(fields()[4], other.commit)) {
        this.commit = data().deepCopy(fields()[4].schema(), other.commit);
        fieldSetFlags()[4] = true;
      }
    }
    
    /** Creates a Builder by copying an existing Program instance */
    private Builder(org.opencb.biodata.models.metadata.Program other) {
            super(org.opencb.biodata.models.metadata.Program.SCHEMA$);
      if (isValidValue(fields()[0], other.name)) {
        this.name = data().deepCopy(fields()[0].schema(), other.name);
        fieldSetFlags()[0] = true;
      }
      if (isValidValue(fields()[1], other.version)) {
        this.version = data().deepCopy(fields()[1].schema(), other.version);
        fieldSetFlags()[1] = true;
      }
      if (isValidValue(fields()[2], other.commandLine)) {
        this.commandLine = data().deepCopy(fields()[2].schema(), other.commandLine);
        fieldSetFlags()[2] = true;
      }
      if (isValidValue(fields()[3], other.url)) {
        this.url = data().deepCopy(fields()[3].schema(), other.url);
        fieldSetFlags()[3] = true;
      }
      if (isValidValue(fields()[4], other.commit)) {
        this.commit = data().deepCopy(fields()[4].schema(), other.commit);
        fieldSetFlags()[4] = true;
      }
    }

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

    /** Gets the value of the 'version' field */
    public java.lang.String getVersion() {
      return version;
    }
    
    /** Sets the value of the 'version' field */
    public org.opencb.biodata.models.metadata.Program.Builder setVersion(java.lang.String value) {
      validate(fields()[1], value);
      this.version = value;
      fieldSetFlags()[1] = true;
      return this; 
    }
    
    /** Checks whether the 'version' field has been set */
    public boolean hasVersion() {
      return fieldSetFlags()[1];
    }
    
    /** Clears the value of the 'version' field */
    public org.opencb.biodata.models.metadata.Program.Builder clearVersion() {
      version = null;
      fieldSetFlags()[1] = false;
      return this;
    }

    /** Gets the value of the 'commandLine' field */
    public java.lang.String getCommandLine() {
      return commandLine;
    }
    
    /** Sets the value of the 'commandLine' field */
    public org.opencb.biodata.models.metadata.Program.Builder setCommandLine(java.lang.String value) {
      validate(fields()[2], value);
      this.commandLine = value;
      fieldSetFlags()[2] = true;
      return this; 
    }
    
    /** Checks whether the 'commandLine' field has been set */
    public boolean hasCommandLine() {
      return fieldSetFlags()[2];
    }
    
    /** Clears the value of the 'commandLine' field */
    public org.opencb.biodata.models.metadata.Program.Builder clearCommandLine() {
      commandLine = null;
      fieldSetFlags()[2] = false;
      return this;
    }

    /** Gets the value of the 'url' field */
    public java.lang.String getUrl() {
      return url;
    }
    
    /** Sets the value of the 'url' field */
    public org.opencb.biodata.models.metadata.Program.Builder setUrl(java.lang.String value) {
      validate(fields()[3], value);
      this.url = value;
      fieldSetFlags()[3] = true;
      return this; 
    }
    
    /** Checks whether the 'url' field has been set */
    public boolean hasUrl() {
      return fieldSetFlags()[3];
    }
    
    /** Clears the value of the 'url' field */
    public org.opencb.biodata.models.metadata.Program.Builder clearUrl() {
      url = null;
      fieldSetFlags()[3] = false;
      return this;
    }

    /** Gets the value of the 'commit' field */
    public java.lang.String getCommit() {
      return commit;
    }
    
    /** Sets the value of the 'commit' field */
    public org.opencb.biodata.models.metadata.Program.Builder setCommit(java.lang.String value) {
      validate(fields()[4], value);
      this.commit = value;
      fieldSetFlags()[4] = true;
      return this; 
    }
    
    /** Checks whether the 'commit' field has been set */
    public boolean hasCommit() {
      return fieldSetFlags()[4];
    }
    
    /** Clears the value of the 'commit' field */
    public org.opencb.biodata.models.metadata.Program.Builder clearCommit() {
      commit = null;
      fieldSetFlags()[4] = false;
      return this;
    }

    @Override
    public Program build() {
      try {
        Program record = new Program();
        record.name = fieldSetFlags()[0] ? this.name : (java.lang.String) defaultValue(fields()[0]);
        record.version = fieldSetFlags()[1] ? this.version : (java.lang.String) defaultValue(fields()[1]);
        record.commandLine = fieldSetFlags()[2] ? this.commandLine : (java.lang.String) defaultValue(fields()[2]);
        record.url = fieldSetFlags()[3] ? this.url : (java.lang.String) defaultValue(fields()[3]);
        record.commit = fieldSetFlags()[4] ? this.commit : (java.lang.String) defaultValue(fields()[4]);
        return record;
      } catch (Exception e) {
        throw new org.apache.avro.AvroRuntimeException(e);
      }
    }
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy