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

org.kitesdk.data.hbase.avro.example.UserActionsModel 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.example;  
@SuppressWarnings("all")
@org.apache.avro.specific.AvroGenerated
public class UserActionsModel 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\":\"UserActionsModel\",\"namespace\":\"org.kitesdk.data.hbase.avro.example\",\"fields\":[{\"name\":\"lastName\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"},\"mapping\":{\"type\":\"key\",\"value\":\"0\"}},{\"name\":\"firstName\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"},\"mapping\":{\"type\":\"key\",\"value\":\"1\"}},{\"name\":\"actions\",\"type\":{\"type\":\"map\",\"values\":{\"type\":\"string\",\"avro.java.string\":\"String\"},\"avro.java.string\":\"String\"},\"mapping\":{\"type\":\"keyAsColumn\",\"value\":\"actions:\"}}],\"tables\":[\"kite_example_user_profiles\"]}");
  public static org.apache.avro.Schema getClassSchema() { return SCHEMA$; }
   private java.lang.String lastName;
   private java.lang.String firstName;
   private java.util.Map actions;

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

  /**
   * All-args constructor.
   */
  public UserActionsModel(java.lang.String lastName, java.lang.String firstName, java.util.Map actions) {
    this.lastName = lastName;
    this.firstName = firstName;
    this.actions = actions;
  }

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

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


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


  /**
   * Gets the value of the 'actions' field.
   */
  public java.util.Map getActions() {
    return actions;
  }


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

    private java.lang.String lastName;
    private java.lang.String firstName;
    private java.util.Map actions;

    /** Creates a new Builder */
    private Builder() {
      super(org.kitesdk.data.hbase.avro.example.UserActionsModel.SCHEMA$);
    }
    
    /** Creates a Builder by copying an existing Builder */
    private Builder(org.kitesdk.data.hbase.avro.example.UserActionsModel.Builder other) {
      super(other);
      if (isValidValue(fields()[0], other.lastName)) {
        this.lastName = data().deepCopy(fields()[0].schema(), other.lastName);
        fieldSetFlags()[0] = true;
      }
      if (isValidValue(fields()[1], other.firstName)) {
        this.firstName = data().deepCopy(fields()[1].schema(), other.firstName);
        fieldSetFlags()[1] = true;
      }
      if (isValidValue(fields()[2], other.actions)) {
        this.actions = data().deepCopy(fields()[2].schema(), other.actions);
        fieldSetFlags()[2] = true;
      }
    }
    
    /** Creates a Builder by copying an existing UserActionsModel instance */
    private Builder(org.kitesdk.data.hbase.avro.example.UserActionsModel other) {
            super(org.kitesdk.data.hbase.avro.example.UserActionsModel.SCHEMA$);
      if (isValidValue(fields()[0], other.lastName)) {
        this.lastName = data().deepCopy(fields()[0].schema(), other.lastName);
        fieldSetFlags()[0] = true;
      }
      if (isValidValue(fields()[1], other.firstName)) {
        this.firstName = data().deepCopy(fields()[1].schema(), other.firstName);
        fieldSetFlags()[1] = true;
      }
      if (isValidValue(fields()[2], other.actions)) {
        this.actions = data().deepCopy(fields()[2].schema(), other.actions);
        fieldSetFlags()[2] = true;
      }
    }

    /** Gets the value of the 'lastName' field */
    public java.lang.String getLastName() {
      return lastName;
    }
    
    /** Sets the value of the 'lastName' field */
    public org.kitesdk.data.hbase.avro.example.UserActionsModel.Builder setLastName(java.lang.String value) {
      validate(fields()[0], value);
      this.lastName = value;
      fieldSetFlags()[0] = true;
      return this; 
    }
    
    /** Checks whether the 'lastName' field has been set */
    public boolean hasLastName() {
      return fieldSetFlags()[0];
    }
    
    /** Clears the value of the 'lastName' field */
    public org.kitesdk.data.hbase.avro.example.UserActionsModel.Builder clearLastName() {
      lastName = null;
      fieldSetFlags()[0] = false;
      return this;
    }

    /** Gets the value of the 'firstName' field */
    public java.lang.String getFirstName() {
      return firstName;
    }
    
    /** Sets the value of the 'firstName' field */
    public org.kitesdk.data.hbase.avro.example.UserActionsModel.Builder setFirstName(java.lang.String value) {
      validate(fields()[1], value);
      this.firstName = value;
      fieldSetFlags()[1] = true;
      return this; 
    }
    
    /** Checks whether the 'firstName' field has been set */
    public boolean hasFirstName() {
      return fieldSetFlags()[1];
    }
    
    /** Clears the value of the 'firstName' field */
    public org.kitesdk.data.hbase.avro.example.UserActionsModel.Builder clearFirstName() {
      firstName = null;
      fieldSetFlags()[1] = false;
      return this;
    }

    /** Gets the value of the 'actions' field */
    public java.util.Map getActions() {
      return actions;
    }
    
    /** Sets the value of the 'actions' field */
    public org.kitesdk.data.hbase.avro.example.UserActionsModel.Builder setActions(java.util.Map value) {
      validate(fields()[2], value);
      this.actions = value;
      fieldSetFlags()[2] = true;
      return this; 
    }
    
    /** Checks whether the 'actions' field has been set */
    public boolean hasActions() {
      return fieldSetFlags()[2];
    }
    
    /** Clears the value of the 'actions' field */
    public org.kitesdk.data.hbase.avro.example.UserActionsModel.Builder clearActions() {
      actions = null;
      fieldSetFlags()[2] = false;
      return this;
    }

    @Override
    public UserActionsModel build() {
      try {
        UserActionsModel record = new UserActionsModel();
        record.lastName = fieldSetFlags()[0] ? this.lastName : (java.lang.String) defaultValue(fields()[0]);
        record.firstName = fieldSetFlags()[1] ? this.firstName : (java.lang.String) defaultValue(fields()[1]);
        record.actions = fieldSetFlags()[2] ? this.actions : (java.util.Map) defaultValue(fields()[2]);
        return record;
      } catch (Exception e) {
        throw new org.apache.avro.AvroRuntimeException(e);
      }
    }
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy