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

org.graylog2.telemetry.user.db.AutoValue_TelemetryUserSettingsDto Maven / Gradle / Ivy

There is a newer version: 6.1.4
Show newest version
package org.graylog2.telemetry.user.db;

import com.fasterxml.jackson.annotation.JsonProperty;
import javax.annotation.Nullable;
import javax.annotation.processing.Generated;
import org.mongojack.Id;
import org.mongojack.ObjectId;

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

  @Nullable
  private final String id;

  private final String userId;

  private final Boolean telemetryEnabled;

  private final Boolean telemetryPermissionAsked;

  private AutoValue_TelemetryUserSettingsDto(
      @Nullable String id,
      String userId,
      Boolean telemetryEnabled,
      Boolean telemetryPermissionAsked) {
    this.id = id;
    this.userId = userId;
    this.telemetryEnabled = telemetryEnabled;
    this.telemetryPermissionAsked = telemetryPermissionAsked;
  }

  @JsonProperty
  @Nullable
  @Id
  @ObjectId
  @Override
  public String id() {
    return id;
  }

  @JsonProperty
  @Override
  public String userId() {
    return userId;
  }

  @JsonProperty
  @Override
  public Boolean telemetryEnabled() {
    return telemetryEnabled;
  }

  @JsonProperty
  @Override
  public Boolean telemetryPermissionAsked() {
    return telemetryPermissionAsked;
  }

  @Override
  public String toString() {
    return "TelemetryUserSettingsDto{"
        + "id=" + id + ", "
        + "userId=" + userId + ", "
        + "telemetryEnabled=" + telemetryEnabled + ", "
        + "telemetryPermissionAsked=" + telemetryPermissionAsked
        + "}";
  }

  @Override
  public boolean equals(Object o) {
    if (o == this) {
      return true;
    }
    if (o instanceof TelemetryUserSettingsDto) {
      TelemetryUserSettingsDto that = (TelemetryUserSettingsDto) o;
      return (this.id == null ? that.id() == null : this.id.equals(that.id()))
          && this.userId.equals(that.userId())
          && this.telemetryEnabled.equals(that.telemetryEnabled())
          && this.telemetryPermissionAsked.equals(that.telemetryPermissionAsked());
    }
    return false;
  }

  @Override
  public int hashCode() {
    int h$ = 1;
    h$ *= 1000003;
    h$ ^= (id == null) ? 0 : id.hashCode();
    h$ *= 1000003;
    h$ ^= userId.hashCode();
    h$ *= 1000003;
    h$ ^= telemetryEnabled.hashCode();
    h$ *= 1000003;
    h$ ^= telemetryPermissionAsked.hashCode();
    return h$;
  }

  static final class Builder extends TelemetryUserSettingsDto.Builder {
    private String id;
    private String userId;
    private Boolean telemetryEnabled;
    private Boolean telemetryPermissionAsked;
    Builder() {
    }
    @Override
    public TelemetryUserSettingsDto.Builder id(String id) {
      this.id = id;
      return this;
    }
    @Override
    public TelemetryUserSettingsDto.Builder userId(String userId) {
      if (userId == null) {
        throw new NullPointerException("Null userId");
      }
      this.userId = userId;
      return this;
    }
    @Override
    public TelemetryUserSettingsDto.Builder telemetryEnabled(Boolean telemetryEnabled) {
      if (telemetryEnabled == null) {
        throw new NullPointerException("Null telemetryEnabled");
      }
      this.telemetryEnabled = telemetryEnabled;
      return this;
    }
    @Override
    public TelemetryUserSettingsDto.Builder telemetryPermissionAsked(Boolean telemetryPermissionAsked) {
      if (telemetryPermissionAsked == null) {
        throw new NullPointerException("Null telemetryPermissionAsked");
      }
      this.telemetryPermissionAsked = telemetryPermissionAsked;
      return this;
    }
    @Override
    public TelemetryUserSettingsDto build() {
      if (this.userId == null
          || this.telemetryEnabled == null
          || this.telemetryPermissionAsked == null) {
        StringBuilder missing = new StringBuilder();
        if (this.userId == null) {
          missing.append(" userId");
        }
        if (this.telemetryEnabled == null) {
          missing.append(" telemetryEnabled");
        }
        if (this.telemetryPermissionAsked == null) {
          missing.append(" telemetryPermissionAsked");
        }
        throw new IllegalStateException("Missing required properties:" + missing);
      }
      return new AutoValue_TelemetryUserSettingsDto(
          this.id,
          this.userId,
          this.telemetryEnabled,
          this.telemetryPermissionAsked);
    }
  }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy