package com.airlock.iam.flow.shared.domain.model.matrix;

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

public final class MatrixChallengeResponse {
   @NonNull
   private final String challenge;
   @NonNull
   private final String response;

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

      if (response == null) {
         throw new NullPointerException("response is marked non-null but is null");
      }

      this.challenge = challenge;
      this.response = response;
   }

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

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

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

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

   @SuppressFBWarnings(justification = "generated code")
   @Override
   public String toString() {
      return "MatrixChallengeResponse(challenge=" + this.getChallenge() + ", response=" + this.getResponse() + ")";
   }
}
