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

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

public final class SecretQuestionProvision {
   @NonNull
   private final String id;
   private final String answer;

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

      this.id = id;
      this.answer = answer;
   }

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

   @SuppressFBWarnings(justification = "generated code")
   public String getAnswer() {
      return this.answer;
   }

   @SuppressFBWarnings(justification = "generated code")
   @Override
   public boolean equals(Object o) {
      if (o == this) {
         return true;
      } else if (!(o instanceof SecretQuestionProvision other)) {
         return false;
      } else {
         Object this$id = this.id;
         Object other$id = other.id;
         if (this$id == null ? other$id == null : this$id.equals(other$id)) {
            Object this$answer = this.answer;
            Object other$answer = other.answer;
            return this$answer == null ? other$answer == null : this$answer.equals(other$answer);
         } else {
            return false;
         }
      }
   }

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

   @SuppressFBWarnings(justification = "generated code")
   @Override
   public String toString() {
      return "SecretQuestionProvision(id=" + this.getId() + ", answer=" + this.getAnswer() + ")";
   }
}
