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

org.kitesdk.data.hbase.avro.entities.TestEntity2 Maven / Gradle / Ivy

There is a newer version: 1.1.0
Show newest version
/**
 * Autogenerated by Avro
 * 
 * DO NOT EDIT DIRECTLY
 */
package org.kitesdk.data.hbase.avro.entities;  
@SuppressWarnings("all")
@org.apache.avro.specific.AvroGenerated
public class TestEntity2 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\":\"TestEntity2\",\"namespace\":\"org.kitesdk.data.hbase.avro.entities\",\"fields\":[{\"name\":\"id\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"name\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"created\",\"type\":\"long\"},{\"name\":\"version\",\"type\":\"long\",\"default\":0}],\"partitions\":[{\"type\":\"identity\",\"source\":\"id\"},{\"type\":\"year\",\"source\":\"created\"},{\"type\":\"month\",\"source\":\"created\"},{\"type\":\"day\",\"source\":\"created\"}],\"mapping\":{\"id\":{\"type\":\"column\",\"value\":\"meta:id\"},\"name\":{\"type\":\"column\",\"value\":\"meta:name\"},\"created\":{\"type\":\"column\",\"value\":\"meta:created\"},\"version\":{\"type\":\"occVersion\"}}}");
  public static org.apache.avro.Schema getClassSchema() { return SCHEMA$; }
   private java.lang.String id;
   private java.lang.String name;
   private long created;
   private long version;

  /**
   * Default constructor.  Note that this does not initialize fields
   * to their default values from the schema.  If that is desired then
   * one should use {@link \#newBuilder()}. 
   */
  public TestEntity2() {}

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

  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;
    case 2: return created;
    case 3: return version;
    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;
    case 2: created = (java.lang.Long)value$; break;
    case 3: version = (java.lang.Long)value$; break;
    default: throw new org.apache.avro.AvroRuntimeException("Bad index");
    }
  }

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


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


  /**
   * Gets the value of the 'created' field.
   */
  public java.lang.Long getCreated() {
    return created;
  }


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


  /** Creates a new TestEntity2 RecordBuilder */
  public static org.kitesdk.data.hbase.avro.entities.TestEntity2.Builder newBuilder() {
    return new org.kitesdk.data.hbase.avro.entities.TestEntity2.Builder();
  }
  
  /** Creates a new TestEntity2 RecordBuilder by copying an existing Builder */
  public static org.kitesdk.data.hbase.avro.entities.TestEntity2.Builder newBuilder(org.kitesdk.data.hbase.avro.entities.TestEntity2.Builder other) {
    return new org.kitesdk.data.hbase.avro.entities.TestEntity2.Builder(other);
  }
  
  /** Creates a new TestEntity2 RecordBuilder by copying an existing TestEntity2 instance */
  public static org.kitesdk.data.hbase.avro.entities.TestEntity2.Builder newBuilder(org.kitesdk.data.hbase.avro.entities.TestEntity2 other) {
    return new org.kitesdk.data.hbase.avro.entities.TestEntity2.Builder(other);
  }
  
  /**
   * RecordBuilder for TestEntity2 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;
    private long created;
    private long version;

    /** Creates a new Builder */
    private Builder() {
      super(org.kitesdk.data.hbase.avro.entities.TestEntity2.SCHEMA$);
    }
    
    /** Creates a Builder by copying an existing Builder */
    private Builder(org.kitesdk.data.hbase.avro.entities.TestEntity2.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;
      }
      if (isValidValue(fields()[2], other.created)) {
        this.created = data().deepCopy(fields()[2].schema(), other.created);
        fieldSetFlags()[2] = true;
      }
      if (isValidValue(fields()[3], other.version)) {
        this.version = data().deepCopy(fields()[3].schema(), other.version);
        fieldSetFlags()[3] = true;
      }
    }
    
    /** Creates a Builder by copying an existing TestEntity2 instance */
    private Builder(org.kitesdk.data.hbase.avro.entities.TestEntity2 other) {
            super(org.kitesdk.data.hbase.avro.entities.TestEntity2.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;
      }
      if (isValidValue(fields()[2], other.created)) {
        this.created = data().deepCopy(fields()[2].schema(), other.created);
        fieldSetFlags()[2] = true;
      }
      if (isValidValue(fields()[3], other.version)) {
        this.version = data().deepCopy(fields()[3].schema(), other.version);
        fieldSetFlags()[3] = true;
      }
    }

    /** Gets the value of the 'id' field */
    public java.lang.String getId() {
      return id;
    }
    
    /** Sets the value of the 'id' field */
    public org.kitesdk.data.hbase.avro.entities.TestEntity2.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.kitesdk.data.hbase.avro.entities.TestEntity2.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.kitesdk.data.hbase.avro.entities.TestEntity2.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.kitesdk.data.hbase.avro.entities.TestEntity2.Builder clearName() {
      name = null;
      fieldSetFlags()[1] = false;
      return this;
    }

    /** Gets the value of the 'created' field */
    public java.lang.Long getCreated() {
      return created;
    }
    
    /** Sets the value of the 'created' field */
    public org.kitesdk.data.hbase.avro.entities.TestEntity2.Builder setCreated(long value) {
      validate(fields()[2], value);
      this.created = value;
      fieldSetFlags()[2] = true;
      return this; 
    }
    
    /** Checks whether the 'created' field has been set */
    public boolean hasCreated() {
      return fieldSetFlags()[2];
    }
    
    /** Clears the value of the 'created' field */
    public org.kitesdk.data.hbase.avro.entities.TestEntity2.Builder clearCreated() {
      fieldSetFlags()[2] = false;
      return this;
    }

    /** Gets the value of the 'version' field */
    public java.lang.Long getVersion() {
      return version;
    }
    
    /** Sets the value of the 'version' field */
    public org.kitesdk.data.hbase.avro.entities.TestEntity2.Builder setVersion(long value) {
      validate(fields()[3], value);
      this.version = value;
      fieldSetFlags()[3] = true;
      return this; 
    }
    
    /** Checks whether the 'version' field has been set */
    public boolean hasVersion() {
      return fieldSetFlags()[3];
    }
    
    /** Clears the value of the 'version' field */
    public org.kitesdk.data.hbase.avro.entities.TestEntity2.Builder clearVersion() {
      fieldSetFlags()[3] = false;
      return this;
    }

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy