package com.airlock.iam.common.domain.model.locking;

import com.airlock.iam.common.api.domain.model.locking.LockReason;
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;

public final class LockReasonImpl implements LockReason {
   private final String resourceKey;

   @Override
   public boolean isSelfUnlockSupported() {
      return false;
   }

   public static LockReason lockReason(String reason) {
      return new LockReasonImpl(reason);
   }

   @SuppressFBWarnings(justification = "generated code")
   @Override
   public String getResourceKey() {
      return this.resourceKey;
   }

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

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

   @SuppressFBWarnings(justification = "generated code")
   @Override
   public String toString() {
      return "LockReasonImpl(resourceKey=" + this.getResourceKey() + ")";
   }

   @SuppressFBWarnings(justification = "generated code")
   private LockReasonImpl(String resourceKey) {
      this.resourceKey = resourceKey;
   }
}
