// Generated by delombok at Sun Nov 06 21:21:45 CET 2022

import lombok.experimental.Tolerate;
import java.util.Optional;

public class BuilderWithSetterPrefixAndExistedMethods {
  private final byte[] secret;
  private Optional<String> name;


  public static class Builder {
    @java.lang.SuppressWarnings("all")
    private byte[] secret;
    @java.lang.SuppressWarnings("all")
    private Optional<String> name;

    public Builder withSecret(String value) {
      secret = value.getBytes();
      return this;
    }

    public Builder withSecret(byte[] value) {
      secret = value;
      return this;
    }

    @Tolerate
    public Builder withName(String name) {
      this.name = Optional.of(name);
      return this;
    }

    @java.lang.SuppressWarnings("all")
    Builder() {
    }

    /**
     * @return {@code this}.
     */
    @java.lang.SuppressWarnings("all")
    public BuilderWithSetterPrefixAndExistedMethods.Builder withName(final Optional<String> name) {
      this.name = name;
      return this;
    }

    @java.lang.SuppressWarnings("all")
    public BuilderWithSetterPrefixAndExistedMethods build() {
      return new BuilderWithSetterPrefixAndExistedMethods(this.secret, this.name);
    }

    @java.lang.Override
    @java.lang.SuppressWarnings("all")
    public java.lang.String toString() {
      return "BuilderWithSetterPrefixAndExistedMethods.Builder(secret=" + java.util.Arrays.toString(this.secret) + ", name=" + this.name + ")";
    }
  }

  public static void main(String[] args) {
    BuilderWithSetterPrefixAndExistedMethods obj = BuilderWithSetterPrefixAndExistedMethods.builder().withSecret("Secret").withName(Optional.of("aaa")).build();
    BuilderWithSetterPrefixAndExistedMethods rtn = obj.toBuilder().build();
    System.out.println(rtn);
  }

  @java.lang.SuppressWarnings("all")
  BuilderWithSetterPrefixAndExistedMethods(final byte[] secret, final Optional<String> name) {
    this.secret = secret;
    this.name = name;
  }

  @java.lang.SuppressWarnings("all")
  public static BuilderWithSetterPrefixAndExistedMethods.Builder builder() {
    return new BuilderWithSetterPrefixAndExistedMethods.Builder();
  }

  @java.lang.SuppressWarnings("all")
  public BuilderWithSetterPrefixAndExistedMethods.Builder toBuilder() {
    return new BuilderWithSetterPrefixAndExistedMethods.Builder().withSecret(this.secret).withName(this.name);
  }

  @java.lang.SuppressWarnings("all")
  public byte[] getSecret() {
    return this.secret;
  }

  @java.lang.SuppressWarnings("all")
  public Optional<String> getName() {
    return this.name;
  }

  @java.lang.SuppressWarnings("all")
  public void setName(final Optional<String> name) {
    this.name = name;
  }

  @java.lang.Override
  @java.lang.SuppressWarnings("all")
  public boolean equals(final java.lang.Object o) {
    if (o == this) return true;
    if (!(o instanceof BuilderWithSetterPrefixAndExistedMethods)) return false;
    final BuilderWithSetterPrefixAndExistedMethods other = (BuilderWithSetterPrefixAndExistedMethods) o;
    if (!other.canEqual((java.lang.Object) this)) return false;
    if (!java.util.Arrays.equals(this.getSecret(), other.getSecret())) return false;
    final java.lang.Object this$name = this.getName();
    final java.lang.Object other$name = other.getName();
    if (this$name == null ? other$name != null : !this$name.equals(other$name)) return false;
    return true;
  }

  @java.lang.SuppressWarnings("all")
  protected boolean canEqual(final java.lang.Object other) {
    return other instanceof BuilderWithSetterPrefixAndExistedMethods;
  }

  @java.lang.Override
  @java.lang.SuppressWarnings("all")
  public int hashCode() {
    final int PRIME = 59;
    int result = 1;
    result = result * PRIME + java.util.Arrays.hashCode(this.getSecret());
    final java.lang.Object $name = this.getName();
    result = result * PRIME + ($name == null ? 43 : $name.hashCode());
    return result;
  }

  @java.lang.Override
  @java.lang.SuppressWarnings("all")
  public java.lang.String toString() {
    return "BuilderWithSetterPrefixAndExistedMethods(secret=" + java.util.Arrays.toString(this.getSecret()) + ", name=" + this.getName() + ")";
  }
}
