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

import com.airlock.iam.common.domain.service.session.IdentityStringGenerator;
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;

public final class FlowFederationSessionId {
   private final String id;

   public static FlowFederationSessionId federationSessionId(String sessionId) {
      return new FlowFederationSessionId(sessionId);
   }

   public static FlowFederationSessionId randomFederationSessionId() {
      return new FlowFederationSessionId(IdentityStringGenerator.generateIdentityString());
   }

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

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

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

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

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