package com.airlock.iam.factor.domain.model.airlock2fa;

import com.airlock.iam.airlock2fa.api.domain.model.Airlock2FAAccountId;
import com.airlock.iam.airlock2fa.api.domain.model.Airlock2FADeviceId;
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;

public final class Airlock2FARegisteredDevice {
   private final Airlock2FADeviceId deviceId;
   private final Airlock2FAAccountId accountId;

   public static Airlock2FARegisteredDevice registeredDevice(Airlock2FADeviceId deviceId, Airlock2FAAccountId accountId) {
      return new Airlock2FARegisteredDevice(deviceId, accountId);
   }

   @SuppressFBWarnings(justification = "generated code")
   public Airlock2FADeviceId deviceId() {
      return this.deviceId;
   }

   @SuppressFBWarnings(justification = "generated code")
   public Airlock2FAAccountId accountId() {
      return this.accountId;
   }

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

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

   @SuppressFBWarnings(justification = "generated code")
   @Override
   public String toString() {
      return "Airlock2FARegisteredDevice(deviceId=" + this.deviceId() + ", accountId=" + this.accountId() + ")";
   }

   @SuppressFBWarnings(justification = "generated code")
   private Airlock2FARegisteredDevice(Airlock2FADeviceId deviceId, Airlock2FAAccountId accountId) {
      this.deviceId = deviceId;
      this.accountId = accountId;
   }
}
