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

me.tfeng.playmods.oauth2.UserAuthentication Maven / Gradle / Ivy

There is a newer version: 0.8.7
Show newest version
/**
 * Autogenerated by Avro
 *
 * DO NOT EDIT DIRECTLY
 */
package me.tfeng.playmods.oauth2;

import org.apache.avro.specific.SpecificData;

@SuppressWarnings("all")
@org.apache.avro.specific.AvroGenerated
public class UserAuthentication extends org.apache.avro.specific.SpecificRecordBase implements org.apache.avro.specific.SpecificRecord {
  private static final long serialVersionUID = 9111407823986200339L;
  public static final org.apache.avro.Schema SCHEMA$ = new org.apache.avro.Schema.Parser().parse("{\"type\":\"record\",\"name\":\"UserAuthentication\",\"namespace\":\"me.tfeng.playmods.oauth2\",\"fields\":[{\"name\":\"id\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"authorities\",\"type\":{\"type\":\"array\",\"items\":{\"type\":\"string\",\"avro.java.string\":\"String\"}}}]}");
  public static org.apache.avro.Schema getClassSchema() { return SCHEMA$; }
  @Deprecated public java.lang.String id;
  @Deprecated public java.util.List authorities;

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

  /**
   * All-args constructor.
   * @param id The new value for id
   * @param authorities The new value for authorities
   */
  public UserAuthentication(java.lang.String id, java.util.List authorities) {
    this.id = id;
    this.authorities = authorities;
  }

  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 authorities;
    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: authorities = (java.util.List)value$; break;
    default: throw new org.apache.avro.AvroRuntimeException("Bad index");
    }
  }

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

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

  /**
   * Gets the value of the 'authorities' field.
   * @return The value of the 'authorities' field.
   */
  public java.util.List getAuthorities() {
    return authorities;
  }

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

  /**
   * Creates a new UserAuthentication RecordBuilder.
   * @return A new UserAuthentication RecordBuilder
   */
  public static me.tfeng.playmods.oauth2.UserAuthentication.Builder newBuilder() {
    return new me.tfeng.playmods.oauth2.UserAuthentication.Builder();
  }

  /**
   * Creates a new UserAuthentication RecordBuilder by copying an existing Builder.
   * @param other The existing builder to copy.
   * @return A new UserAuthentication RecordBuilder
   */
  public static me.tfeng.playmods.oauth2.UserAuthentication.Builder newBuilder(me.tfeng.playmods.oauth2.UserAuthentication.Builder other) {
    return new me.tfeng.playmods.oauth2.UserAuthentication.Builder(other);
  }

  /**
   * Creates a new UserAuthentication RecordBuilder by copying an existing UserAuthentication instance.
   * @param other The existing instance to copy.
   * @return A new UserAuthentication RecordBuilder
   */
  public static me.tfeng.playmods.oauth2.UserAuthentication.Builder newBuilder(me.tfeng.playmods.oauth2.UserAuthentication other) {
    return new me.tfeng.playmods.oauth2.UserAuthentication.Builder(other);
  }

  /**
   * RecordBuilder for UserAuthentication instances.
   */
  public static class Builder extends org.apache.avro.specific.SpecificRecordBuilderBase
    implements org.apache.avro.data.RecordBuilder {

    private java.lang.String id;
    private java.util.List authorities;

    /** Creates a new Builder */
    private Builder() {
      super(SCHEMA$);
    }

    /**
     * Creates a Builder by copying an existing Builder.
     * @param other The existing Builder to copy.
     */
    private Builder(me.tfeng.playmods.oauth2.UserAuthentication.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.authorities)) {
        this.authorities = data().deepCopy(fields()[1].schema(), other.authorities);
        fieldSetFlags()[1] = true;
      }
    }

    /**
     * Creates a Builder by copying an existing UserAuthentication instance
     * @param other The existing instance to copy.
     */
    private Builder(me.tfeng.playmods.oauth2.UserAuthentication other) {
            super(SCHEMA$);
      if (isValidValue(fields()[0], other.id)) {
        this.id = data().deepCopy(fields()[0].schema(), other.id);
        fieldSetFlags()[0] = true;
      }
      if (isValidValue(fields()[1], other.authorities)) {
        this.authorities = data().deepCopy(fields()[1].schema(), other.authorities);
        fieldSetFlags()[1] = true;
      }
    }

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

    /**
      * Sets the value of the 'id' field.
      * @param value The value of 'id'.
      * @return This builder.
      */
    public me.tfeng.playmods.oauth2.UserAuthentication.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.
      * @return True if the 'id' field has been set, false otherwise.
      */
    public boolean hasId() {
      return fieldSetFlags()[0];
    }


    /**
      * Clears the value of the 'id' field.
      * @return This builder.
      */
    public me.tfeng.playmods.oauth2.UserAuthentication.Builder clearId() {
      id = null;
      fieldSetFlags()[0] = false;
      return this;
    }

    /**
      * Gets the value of the 'authorities' field.
      * @return The value.
      */
    public java.util.List getAuthorities() {
      return authorities;
    }

    /**
      * Sets the value of the 'authorities' field.
      * @param value The value of 'authorities'.
      * @return This builder.
      */
    public me.tfeng.playmods.oauth2.UserAuthentication.Builder setAuthorities(java.util.List value) {
      validate(fields()[1], value);
      this.authorities = value;
      fieldSetFlags()[1] = true;
      return this;
    }

    /**
      * Checks whether the 'authorities' field has been set.
      * @return True if the 'authorities' field has been set, false otherwise.
      */
    public boolean hasAuthorities() {
      return fieldSetFlags()[1];
    }


    /**
      * Clears the value of the 'authorities' field.
      * @return This builder.
      */
    public me.tfeng.playmods.oauth2.UserAuthentication.Builder clearAuthorities() {
      authorities = null;
      fieldSetFlags()[1] = false;
      return this;
    }

    @Override
    public UserAuthentication build() {
      try {
        UserAuthentication record = new UserAuthentication();
        record.id = fieldSetFlags()[0] ? this.id : (java.lang.String) defaultValue(fields()[0]);
        record.authorities = fieldSetFlags()[1] ? this.authorities : (java.util.List) defaultValue(fields()[1]);
        return record;
      } catch (Exception e) {
        throw new org.apache.avro.AvroRuntimeException(e);
      }
    }
  }

  private static final org.apache.avro.io.DatumWriter
    WRITER$ = new org.apache.avro.specific.SpecificDatumWriter(SCHEMA$);

  @Override public void writeExternal(java.io.ObjectOutput out)
    throws java.io.IOException {
    WRITER$.write(this, SpecificData.getEncoder(out));
  }

  private static final org.apache.avro.io.DatumReader
    READER$ = new org.apache.avro.specific.SpecificDatumReader(SCHEMA$);

  @Override public void readExternal(java.io.ObjectInput in)
    throws java.io.IOException {
    READER$.read(this, SpecificData.getDecoder(in));
  }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy