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.1.4
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;
    private byte set$0;
    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;
      set$0 |= (byte) 1;
      return this;
    }
    @Override
    public EncryptedValue.Builder isDeleteValue(boolean isDeleteValue) {
      this.isDeleteValue = isDeleteValue;
      set$0 |= (byte) 2;
      return this;
    }
    @Override
    public EncryptedValue build() {
      if (set$0 != 3
          || this.value == null
          || this.salt == null) {
        StringBuilder missing = new StringBuilder();
        if (this.value == null) {
          missing.append(" value");
        }
        if (this.salt == null) {
          missing.append(" salt");
        }
        if ((set$0 & 1) == 0) {
          missing.append(" isKeepValue");
        }
        if ((set$0 & 2) == 0) {
          missing.append(" isDeleteValue");
        }
        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