package com.airlock.iam.authentication.domain.model.secretquestions;

import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import lombok.NonNull;

public final class SecretQuestionStatus {
   @NonNull
   private final String id;
   private final boolean answerProvisioned;

   @SuppressFBWarnings(justification = "generated code")
   SecretQuestionStatus(@NonNull String id, boolean answerProvisioned) {
      if (id == null) {
         throw new NullPointerException("id is marked non-null but is null");
      }

      this.id = id;
      this.answerProvisioned = answerProvisioned;
   }

   @SuppressFBWarnings(justification = "generated code")
   public static SecretQuestionStatus.SecretQuestionStatusBuilder builder() {
      return new SecretQuestionStatus.SecretQuestionStatusBuilder();
   }

   @NonNull
   @SuppressFBWarnings(justification = "generated code")
   public String getId() {
      return this.id;
   }

   @SuppressFBWarnings(justification = "generated code")
   public boolean isAnswerProvisioned() {
      return this.answerProvisioned;
   }

   @SuppressFBWarnings(justification = "generated code")
   @Override
   public boolean equals(Object o) {
      if (o == this) {
         return true;
      } else if (!(o instanceof SecretQuestionStatus other)) {
         return false;
      } else {
         if (this.answerProvisioned != other.answerProvisioned) {
            return false;
         }

         Object this$id = this.id;
         Object other$id = other.id;
         return this$id == null ? other$id == null : this$id.equals(other$id);
      }
   }

   @SuppressFBWarnings(justification = "generated code")
   @Override
   public int hashCode() {
      int PRIME = 59;
      int result = 1;
      result = result * 59 + (this.answerProvisioned ? 79 : 97);
      Object $id = this.id;
      return result * 59 + ($id == null ? 43 : $id.hashCode());
   }

   @SuppressFBWarnings(justification = "generated code")
   @Override
   public String toString() {
      return "SecretQuestionStatus(id=" + this.getId() + ", answerProvisioned=" + this.isAnswerProvisioned() + ")";
   }

   @SuppressFBWarnings(justification = "generated code")
   public static class SecretQuestionStatusBuilder {
      @SuppressFBWarnings(justification = "generated code")
      private String id;
      @SuppressFBWarnings(justification = "generated code")
      private boolean answerProvisioned;

      @SuppressFBWarnings(justification = "generated code")
      SecretQuestionStatusBuilder() {
      }

      @SuppressFBWarnings(justification = "generated code")
      public SecretQuestionStatus.SecretQuestionStatusBuilder id(@NonNull String id) {
         if (id == null) {
            throw new NullPointerException("id is marked non-null but is null");
         }

         this.id = id;
         return this;
      }

      @SuppressFBWarnings(justification = "generated code")
      public SecretQuestionStatus.SecretQuestionStatusBuilder answerProvisioned(boolean answerProvisioned) {
         this.answerProvisioned = answerProvisioned;
         return this;
      }

      @SuppressFBWarnings(justification = "generated code")
      public SecretQuestionStatus build() {
         return new SecretQuestionStatus(this.id, this.answerProvisioned);
      }

      @SuppressFBWarnings(justification = "generated code")
      @Override
      public String toString() {
         return "SecretQuestionStatus.SecretQuestionStatusBuilder(id=" + this.id + ", answerProvisioned=" + this.answerProvisioned + ")";
      }
   }
}
