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

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

/**
 * Autogenerated by Avro
 * 
 * DO NOT EDIT DIRECTLY
 */
package org.gel.models.report.avro;  
@SuppressWarnings("all")
@org.apache.avro.specific.AvroGenerated
public class User 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\":\"User\",\"namespace\":\"org.gel.models.report.avro\",\"fields\":[{\"name\":\"userid\",\"type\":[\"null\",{\"type\":\"string\",\"avro.java.string\":\"String\"}],\"doc\":\"Azure Active Directory immutable user OID\"},{\"name\":\"email\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"},\"doc\":\"User email address\"},{\"name\":\"username\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"},\"doc\":\"Username\"},{\"name\":\"role\",\"type\":[\"null\",{\"type\":\"string\",\"avro.java.string\":\"String\"}]},{\"name\":\"groups\",\"type\":[\"null\",{\"type\":\"array\",\"items\":{\"type\":\"string\",\"avro.java.string\":\"String\"}}]}]}");
  public static org.apache.avro.Schema getClassSchema() { return SCHEMA$; }
  /** Azure Active Directory immutable user OID */
   private java.lang.String userid;
  /** User email address */
   private java.lang.String email;
  /** Username */
   private java.lang.String username;
   private java.lang.String role;
   private java.util.List groups;

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

  /**
   * All-args constructor.
   */
  public User(java.lang.String userid, java.lang.String email, java.lang.String username, java.lang.String role, java.util.List groups) {
    this.userid = userid;
    this.email = email;
    this.username = username;
    this.role = role;
    this.groups = groups;
  }

  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 userid;
    case 1: return email;
    case 2: return username;
    case 3: return role;
    case 4: return groups;
    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: userid = (java.lang.String)value$; break;
    case 1: email = (java.lang.String)value$; break;
    case 2: username = (java.lang.String)value$; break;
    case 3: role = (java.lang.String)value$; break;
    case 4: groups = (java.util.List)value$; break;
    default: throw new org.apache.avro.AvroRuntimeException("Bad index");
    }
  }

  /**
   * Gets the value of the 'userid' field.
   * Azure Active Directory immutable user OID   */
  public java.lang.String getUserid() {
    return userid;
  }

  /**
   * Sets the value of the 'userid' field.
   * Azure Active Directory immutable user OID   * @param value the value to set.
   */
  public void setUserid(java.lang.String value) {
    this.userid = value;
  }

  /**
   * Gets the value of the 'email' field.
   * User email address   */
  public java.lang.String getEmail() {
    return email;
  }

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

  /**
   * Gets the value of the 'username' field.
   * Username   */
  public java.lang.String getUsername() {
    return username;
  }

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

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

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

  /**
   * Gets the value of the 'groups' field.
   */
  public java.util.List getGroups() {
    return groups;
  }

  /**
   * Sets the value of the 'groups' field.
   * @param value the value to set.
   */
  public void setGroups(java.util.List value) {
    this.groups = value;
  }

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

    private java.lang.String userid;
    private java.lang.String email;
    private java.lang.String username;
    private java.lang.String role;
    private java.util.List groups;

    /** Creates a new Builder */
    private Builder() {
      super(org.gel.models.report.avro.User.SCHEMA$);
    }
    
    /** Creates a Builder by copying an existing Builder */
    private Builder(org.gel.models.report.avro.User.Builder other) {
      super(other);
      if (isValidValue(fields()[0], other.userid)) {
        this.userid = data().deepCopy(fields()[0].schema(), other.userid);
        fieldSetFlags()[0] = true;
      }
      if (isValidValue(fields()[1], other.email)) {
        this.email = data().deepCopy(fields()[1].schema(), other.email);
        fieldSetFlags()[1] = true;
      }
      if (isValidValue(fields()[2], other.username)) {
        this.username = data().deepCopy(fields()[2].schema(), other.username);
        fieldSetFlags()[2] = true;
      }
      if (isValidValue(fields()[3], other.role)) {
        this.role = data().deepCopy(fields()[3].schema(), other.role);
        fieldSetFlags()[3] = true;
      }
      if (isValidValue(fields()[4], other.groups)) {
        this.groups = data().deepCopy(fields()[4].schema(), other.groups);
        fieldSetFlags()[4] = true;
      }
    }
    
    /** Creates a Builder by copying an existing User instance */
    private Builder(org.gel.models.report.avro.User other) {
            super(org.gel.models.report.avro.User.SCHEMA$);
      if (isValidValue(fields()[0], other.userid)) {
        this.userid = data().deepCopy(fields()[0].schema(), other.userid);
        fieldSetFlags()[0] = true;
      }
      if (isValidValue(fields()[1], other.email)) {
        this.email = data().deepCopy(fields()[1].schema(), other.email);
        fieldSetFlags()[1] = true;
      }
      if (isValidValue(fields()[2], other.username)) {
        this.username = data().deepCopy(fields()[2].schema(), other.username);
        fieldSetFlags()[2] = true;
      }
      if (isValidValue(fields()[3], other.role)) {
        this.role = data().deepCopy(fields()[3].schema(), other.role);
        fieldSetFlags()[3] = true;
      }
      if (isValidValue(fields()[4], other.groups)) {
        this.groups = data().deepCopy(fields()[4].schema(), other.groups);
        fieldSetFlags()[4] = true;
      }
    }

    /** Gets the value of the 'userid' field */
    public java.lang.String getUserid() {
      return userid;
    }
    
    /** Sets the value of the 'userid' field */
    public org.gel.models.report.avro.User.Builder setUserid(java.lang.String value) {
      validate(fields()[0], value);
      this.userid = value;
      fieldSetFlags()[0] = true;
      return this; 
    }
    
    /** Checks whether the 'userid' field has been set */
    public boolean hasUserid() {
      return fieldSetFlags()[0];
    }
    
    /** Clears the value of the 'userid' field */
    public org.gel.models.report.avro.User.Builder clearUserid() {
      userid = null;
      fieldSetFlags()[0] = false;
      return this;
    }

    /** Gets the value of the 'email' field */
    public java.lang.String getEmail() {
      return email;
    }
    
    /** Sets the value of the 'email' field */
    public org.gel.models.report.avro.User.Builder setEmail(java.lang.String value) {
      validate(fields()[1], value);
      this.email = value;
      fieldSetFlags()[1] = true;
      return this; 
    }
    
    /** Checks whether the 'email' field has been set */
    public boolean hasEmail() {
      return fieldSetFlags()[1];
    }
    
    /** Clears the value of the 'email' field */
    public org.gel.models.report.avro.User.Builder clearEmail() {
      email = null;
      fieldSetFlags()[1] = false;
      return this;
    }

    /** Gets the value of the 'username' field */
    public java.lang.String getUsername() {
      return username;
    }
    
    /** Sets the value of the 'username' field */
    public org.gel.models.report.avro.User.Builder setUsername(java.lang.String value) {
      validate(fields()[2], value);
      this.username = value;
      fieldSetFlags()[2] = true;
      return this; 
    }
    
    /** Checks whether the 'username' field has been set */
    public boolean hasUsername() {
      return fieldSetFlags()[2];
    }
    
    /** Clears the value of the 'username' field */
    public org.gel.models.report.avro.User.Builder clearUsername() {
      username = null;
      fieldSetFlags()[2] = false;
      return this;
    }

    /** Gets the value of the 'role' field */
    public java.lang.String getRole() {
      return role;
    }
    
    /** Sets the value of the 'role' field */
    public org.gel.models.report.avro.User.Builder setRole(java.lang.String value) {
      validate(fields()[3], value);
      this.role = value;
      fieldSetFlags()[3] = true;
      return this; 
    }
    
    /** Checks whether the 'role' field has been set */
    public boolean hasRole() {
      return fieldSetFlags()[3];
    }
    
    /** Clears the value of the 'role' field */
    public org.gel.models.report.avro.User.Builder clearRole() {
      role = null;
      fieldSetFlags()[3] = false;
      return this;
    }

    /** Gets the value of the 'groups' field */
    public java.util.List getGroups() {
      return groups;
    }
    
    /** Sets the value of the 'groups' field */
    public org.gel.models.report.avro.User.Builder setGroups(java.util.List value) {
      validate(fields()[4], value);
      this.groups = value;
      fieldSetFlags()[4] = true;
      return this; 
    }
    
    /** Checks whether the 'groups' field has been set */
    public boolean hasGroups() {
      return fieldSetFlags()[4];
    }
    
    /** Clears the value of the 'groups' field */
    public org.gel.models.report.avro.User.Builder clearGroups() {
      groups = null;
      fieldSetFlags()[4] = false;
      return this;
    }

    @Override
    public User build() {
      try {
        User record = new User();
        record.userid = fieldSetFlags()[0] ? this.userid : (java.lang.String) defaultValue(fields()[0]);
        record.email = fieldSetFlags()[1] ? this.email : (java.lang.String) defaultValue(fields()[1]);
        record.username = fieldSetFlags()[2] ? this.username : (java.lang.String) defaultValue(fields()[2]);
        record.role = fieldSetFlags()[3] ? this.role : (java.lang.String) defaultValue(fields()[3]);
        record.groups = fieldSetFlags()[4] ? this.groups : (java.util.List) defaultValue(fields()[4]);
        return record;
      } catch (Exception e) {
        throw new org.apache.avro.AvroRuntimeException(e);
      }
    }
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy