package com.airlock.iam.saml2.domain.model.idp;

import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import org.apache.commons.lang3.Validate;

public final class Saml2FederationSessionIndex {
   private final String sessionIndex;

   private Saml2FederationSessionIndex(String sessionIndex) {
      Validate.notBlank(sessionIndex);
      this.sessionIndex = sessionIndex;
   }

   public String value() {
      return this.sessionIndex;
   }

   @Override
   public String toString() {
      return this.sessionIndex;
   }

   public static Saml2FederationSessionIndex saml2FederationSessionIndex(String value) {
      return new Saml2FederationSessionIndex(value);
   }

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

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