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

org.dummy.avro.DummyFile Maven / Gradle / Ivy

/**
 * Autogenerated by Avro
 * 
 * DO NOT EDIT DIRECTLY
 */
package org.dummy.avro;  
@SuppressWarnings("all")
@org.apache.avro.specific.AvroGenerated
public class DummyFile 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\":\"DummyFile\",\"namespace\":\"org.dummy.avro\",\"fields\":[{\"name\":\"url\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"file_name\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"file_type\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}}]}");
  public static org.apache.avro.Schema getClassSchema() { return SCHEMA$; }
   private java.lang.String url;
   private java.lang.String file_name;
   private java.lang.String file_type;

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

  /**
   * All-args constructor.
   */
  public DummyFile(java.lang.String url, java.lang.String file_name, java.lang.String file_type) {
    this.url = url;
    this.file_name = file_name;
    this.file_type = file_type;
  }

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

  /**
   * 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 'file_name' field.
   */
  public java.lang.String getFileName() {
    return file_name;
  }

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

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

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

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

    private java.lang.String url;
    private java.lang.String file_name;
    private java.lang.String file_type;

    /** Creates a new Builder */
    private Builder() {
      super(org.dummy.avro.DummyFile.SCHEMA$);
    }
    
    /** Creates a Builder by copying an existing Builder */
    private Builder(org.dummy.avro.DummyFile.Builder other) {
      super(other);
      if (isValidValue(fields()[0], other.url)) {
        this.url = data().deepCopy(fields()[0].schema(), other.url);
        fieldSetFlags()[0] = true;
      }
      if (isValidValue(fields()[1], other.file_name)) {
        this.file_name = data().deepCopy(fields()[1].schema(), other.file_name);
        fieldSetFlags()[1] = true;
      }
      if (isValidValue(fields()[2], other.file_type)) {
        this.file_type = data().deepCopy(fields()[2].schema(), other.file_type);
        fieldSetFlags()[2] = true;
      }
    }
    
    /** Creates a Builder by copying an existing DummyFile instance */
    private Builder(org.dummy.avro.DummyFile other) {
            super(org.dummy.avro.DummyFile.SCHEMA$);
      if (isValidValue(fields()[0], other.url)) {
        this.url = data().deepCopy(fields()[0].schema(), other.url);
        fieldSetFlags()[0] = true;
      }
      if (isValidValue(fields()[1], other.file_name)) {
        this.file_name = data().deepCopy(fields()[1].schema(), other.file_name);
        fieldSetFlags()[1] = true;
      }
      if (isValidValue(fields()[2], other.file_type)) {
        this.file_type = data().deepCopy(fields()[2].schema(), other.file_type);
        fieldSetFlags()[2] = true;
      }
    }

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

    /** Gets the value of the 'file_name' field */
    public java.lang.String getFileName() {
      return file_name;
    }
    
    /** Sets the value of the 'file_name' field */
    public org.dummy.avro.DummyFile.Builder setFileName(java.lang.String value) {
      validate(fields()[1], value);
      this.file_name = value;
      fieldSetFlags()[1] = true;
      return this; 
    }
    
    /** Checks whether the 'file_name' field has been set */
    public boolean hasFileName() {
      return fieldSetFlags()[1];
    }
    
    /** Clears the value of the 'file_name' field */
    public org.dummy.avro.DummyFile.Builder clearFileName() {
      file_name = null;
      fieldSetFlags()[1] = false;
      return this;
    }

    /** Gets the value of the 'file_type' field */
    public java.lang.String getFileType() {
      return file_type;
    }
    
    /** Sets the value of the 'file_type' field */
    public org.dummy.avro.DummyFile.Builder setFileType(java.lang.String value) {
      validate(fields()[2], value);
      this.file_type = value;
      fieldSetFlags()[2] = true;
      return this; 
    }
    
    /** Checks whether the 'file_type' field has been set */
    public boolean hasFileType() {
      return fieldSetFlags()[2];
    }
    
    /** Clears the value of the 'file_type' field */
    public org.dummy.avro.DummyFile.Builder clearFileType() {
      file_type = null;
      fieldSetFlags()[2] = false;
      return this;
    }

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy