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

com.google.gerrit.entities.AutoValue_Account Maven / Gradle / Ivy

There is a newer version: 3.10.0
Show newest version
package com.google.gerrit.entities;

import com.google.gerrit.common.Nullable;
import java.sql.Timestamp;
import javax.annotation.processing.Generated;

@Generated("com.google.auto.value.processor.AutoValueProcessor")
final class AutoValue_Account extends Account {

  private final Account.Id id;

  private final Timestamp registeredOn;

  private final String fullName;

  private final String displayName;

  private final String preferredEmail;

  private final boolean inactive;

  private final String status;

  private final String metaId;

  private AutoValue_Account(
      Account.Id id,
      Timestamp registeredOn,
      @Nullable String fullName,
      @Nullable String displayName,
      @Nullable String preferredEmail,
      boolean inactive,
      @Nullable String status,
      @Nullable String metaId) {
    this.id = id;
    this.registeredOn = registeredOn;
    this.fullName = fullName;
    this.displayName = displayName;
    this.preferredEmail = preferredEmail;
    this.inactive = inactive;
    this.status = status;
    this.metaId = metaId;
  }

  @Override
  public Account.Id id() {
    return id;
  }

  @Override
  public Timestamp registeredOn() {
    return registeredOn;
  }

  @Nullable
  @Override
  public String fullName() {
    return fullName;
  }

  @Nullable
  @Override
  public String displayName() {
    return displayName;
  }

  @Nullable
  @Override
  public String preferredEmail() {
    return preferredEmail;
  }

  @Override
  public boolean inactive() {
    return inactive;
  }

  @Nullable
  @Override
  public String status() {
    return status;
  }

  @Nullable
  @Override
  public String metaId() {
    return metaId;
  }

  @Override
  public boolean equals(Object o) {
    if (o == this) {
      return true;
    }
    if (o instanceof Account) {
      Account that = (Account) o;
      return this.id.equals(that.id())
          && this.registeredOn.equals(that.registeredOn())
          && (this.fullName == null ? that.fullName() == null : this.fullName.equals(that.fullName()))
          && (this.displayName == null ? that.displayName() == null : this.displayName.equals(that.displayName()))
          && (this.preferredEmail == null ? that.preferredEmail() == null : this.preferredEmail.equals(that.preferredEmail()))
          && this.inactive == that.inactive()
          && (this.status == null ? that.status() == null : this.status.equals(that.status()))
          && (this.metaId == null ? that.metaId() == null : this.metaId.equals(that.metaId()));
    }
    return false;
  }

  @Override
  public int hashCode() {
    int h$ = 1;
    h$ *= 1000003;
    h$ ^= id.hashCode();
    h$ *= 1000003;
    h$ ^= registeredOn.hashCode();
    h$ *= 1000003;
    h$ ^= (fullName == null) ? 0 : fullName.hashCode();
    h$ *= 1000003;
    h$ ^= (displayName == null) ? 0 : displayName.hashCode();
    h$ *= 1000003;
    h$ ^= (preferredEmail == null) ? 0 : preferredEmail.hashCode();
    h$ *= 1000003;
    h$ ^= inactive ? 1231 : 1237;
    h$ *= 1000003;
    h$ ^= (status == null) ? 0 : status.hashCode();
    h$ *= 1000003;
    h$ ^= (metaId == null) ? 0 : metaId.hashCode();
    return h$;
  }

  @Override
  public Account.Builder toBuilder() {
    return new Builder(this);
  }

  static final class Builder extends Account.Builder {
    private Account.Id id;
    private Timestamp registeredOn;
    private String fullName;
    private String displayName;
    private String preferredEmail;
    private Boolean inactive;
    private String status;
    private String metaId;
    Builder() {
    }
    private Builder(Account source) {
      this.id = source.id();
      this.registeredOn = source.registeredOn();
      this.fullName = source.fullName();
      this.displayName = source.displayName();
      this.preferredEmail = source.preferredEmail();
      this.inactive = source.inactive();
      this.status = source.status();
      this.metaId = source.metaId();
    }
    @Override
    Account.Builder setId(Account.Id id) {
      if (id == null) {
        throw new NullPointerException("Null id");
      }
      this.id = id;
      return this;
    }
    @Override
    public Account.Id id() {
      if (id == null) {
        throw new IllegalStateException("Property \"id\" has not been set");
      }
      return id;
    }
    @Override
    Account.Builder setRegisteredOn(Timestamp registeredOn) {
      if (registeredOn == null) {
        throw new NullPointerException("Null registeredOn");
      }
      this.registeredOn = registeredOn;
      return this;
    }
    @Override
    public Timestamp registeredOn() {
      if (registeredOn == null) {
        throw new IllegalStateException("Property \"registeredOn\" has not been set");
      }
      return registeredOn;
    }
    @Override
    public Account.Builder setFullName(String fullName) {
      this.fullName = fullName;
      return this;
    }
    @Override
    @Nullable public String fullName() {
      return fullName;
    }
    @Override
    public Account.Builder setDisplayName(String displayName) {
      this.displayName = displayName;
      return this;
    }
    @Override
    @Nullable public String displayName() {
      return displayName;
    }
    @Override
    public Account.Builder setPreferredEmail(String preferredEmail) {
      this.preferredEmail = preferredEmail;
      return this;
    }
    @Override
    @Nullable public String preferredEmail() {
      return preferredEmail;
    }
    @Override
    public Account.Builder setInactive(boolean inactive) {
      this.inactive = inactive;
      return this;
    }
    @Override
    public boolean inactive() {
      if (inactive == null) {
        throw new IllegalStateException("Property \"inactive\" has not been set");
      }
      return inactive;
    }
    @Override
    public Account.Builder setStatus(String status) {
      this.status = status;
      return this;
    }
    @Override
    @Nullable public String status() {
      return status;
    }
    @Override
    public Account.Builder setMetaId(@Nullable String metaId) {
      this.metaId = metaId;
      return this;
    }
    @Override
    @Nullable public String metaId() {
      return metaId;
    }
    @Override
    public Account build() {
      String missing = "";
      if (this.id == null) {
        missing += " id";
      }
      if (this.registeredOn == null) {
        missing += " registeredOn";
      }
      if (this.inactive == null) {
        missing += " inactive";
      }
      if (!missing.isEmpty()) {
        throw new IllegalStateException("Missing required properties:" + missing);
      }
      return new AutoValue_Account(
          this.id,
          this.registeredOn,
          this.fullName,
          this.displayName,
          this.preferredEmail,
          this.inactive,
          this.status,
          this.metaId);
    }
  }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy