package com.airlock.iam.common.domain.model.auth.idpropagation;

import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import java.time.Duration;

public final class WafCredentialIdleTimeout {
   private final Duration idleTimeout;

   public static WafCredentialIdleTimeout idleTimeout(Duration idleTimeout) {
      return new WafCredentialIdleTimeout(idleTimeout);
   }

   public String formatForWaf() {
      return ":" + this.idleTimeout.getSeconds();
   }

   @SuppressFBWarnings(justification = "generated code")
   public Duration getIdleTimeout() {
      return this.idleTimeout;
   }

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

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

   @SuppressFBWarnings(justification = "generated code")
   @Override
   public String toString() {
      return "WafCredentialIdleTimeout(idleTimeout=" + this.getIdleTimeout() + ")";
   }

   @SuppressFBWarnings(justification = "generated code")
   private WafCredentialIdleTimeout(Duration idleTimeout) {
      this.idleTimeout = idleTimeout;
   }
}
