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

org.graylog2.security.encryption.AutoValue_EncryptedValue Maven / Gradle / Ivy

There is a newer version: 6.0.1
Show newest version
package org.graylog2.security.encryption;

import javax.annotation.processing.Generated;

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

  private final String value;

  private final String salt;

  private final boolean isKeepValue;

  private final boolean isDeleteValue;

  private AutoValue_EncryptedValue(
      String value,
      String salt,
      boolean isKeepValue,
      boolean isDeleteValue) {
    this.value = value;
    this.salt = salt;
    this.isKeepValue = isKeepValue;
    this.isDeleteValue = isDeleteValue;
  }

  @Override
  public String value() {
    return value;
  }

  @Override
  public String salt() {
    return salt;
  }

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

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

  @Override
  public String toString() {
    return "EncryptedValue{"
        + "value=" + value + ", "
        + "salt=" + salt + ", "
        + "isKeepValue=" + isKeepValue + ", "
        + "isDeleteValue=" + isDeleteValue
        + "}";
  }

  @Override
  public boolean equals(Object o) {
    if (o == this) {
      return true;
    }
    if (o instanceof EncryptedValue) {
      EncryptedValue that = (EncryptedValue) o;
      return this.value.equals(that.value())
          && this.salt.equals(that.salt())
          && this.isKeepValue == that.isKeepValue()
          && this.isDeleteValue == that.isDeleteValue();
    }
    return false;
  }

  @Override
  public int hashCode() {
    int h$ = 1;
    h$ *= 1000003;
    h$ ^= value.hashCode();
    h$ *= 1000003;
    h$ ^= salt.hashCode();
    h$ *= 1000003;
    h$ ^= isKeepValue ? 1231 : 1237;
    h$ *= 1000003;
    h$ ^= isDeleteValue ? 1231 : 1237;
    return h$;
  }

  static final class Builder extends EncryptedValue.Builder {
    private String value;
    private String salt;
    private Boolean isKeepValue;
    private Boolean isDeleteValue;
    Builder() {
    }
    @Override
    public EncryptedValue.Builder value(String value) {
      if (value == null) {
        throw new NullPointerException("Null value");
      }
      this.value = value;
      return this;
    }
    @Override
    public EncryptedValue.Builder salt(String salt) {
      if (salt == null) {
        throw new NullPointerException("Null salt");
      }
      this.salt = salt;
      return this;
    }
    @Override
    public EncryptedValue.Builder isKeepValue(boolean isKeepValue) {
      this.isKeepValue = isKeepValue;
      return this;
    }
    @Override
    public EncryptedValue.Builder isDeleteValue(boolean isDeleteValue) {
      this.isDeleteValue = isDeleteValue;
      return this;
    }
    @Override
    public EncryptedValue build() {
      String missing = "";
      if (this.value == null) {
        missing += " value";
      }
      if (this.salt == null) {
        missing += " salt";
      }
      if (this.isKeepValue == null) {
        missing += " isKeepValue";
      }
      if (this.isDeleteValue == null) {
        missing += " isDeleteValue";
      }
      if (!missing.isEmpty()) {
        throw new IllegalStateException("Missing required properties:" + missing);
      }
      return new AutoValue_EncryptedValue(
          this.value,
          this.salt,
          this.isKeepValue,
          this.isDeleteValue);
    }
  }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy