package com.airlock.iam.flow.api.domain.model.flowcontrol;

import com.airlock.iam.flow.api.domain.model.step.StepId;
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import lombok.NonNull;

public final class DynamicStepActivationTarget {
   @NonNull
   private final StepId targetStepId;
   private final boolean activatable;
   private final boolean deactivatable;
   private final boolean activated;

   @SuppressFBWarnings(justification = "generated code")
   public DynamicStepActivationTarget(@NonNull StepId targetStepId, boolean activatable, boolean deactivatable, boolean activated) {
      if (targetStepId == null) {
         throw new NullPointerException("targetStepId is marked non-null but is null");
      }

      this.targetStepId = targetStepId;
      this.activatable = activatable;
      this.deactivatable = deactivatable;
      this.activated = activated;
   }

   @NonNull
   @SuppressFBWarnings(justification = "generated code")
   public StepId getTargetStepId() {
      return this.targetStepId;
   }

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

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

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

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

         if (this.deactivatable != other.deactivatable) {
            return false;
         }

         if (this.activated != other.activated) {
            return false;
         }

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

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

   @SuppressFBWarnings(justification = "generated code")
   @Override
   public String toString() {
      return "DynamicStepActivationTarget(targetStepId="
         + this.getTargetStepId()
         + ", activatable="
         + this.isActivatable()
         + ", deactivatable="
         + this.isDeactivatable()
         + ", activated="
         + this.isActivated()
         + ")";
   }
}
