package com.airlock.iam.saml2.domain.model.sp.logout;

import com.airlock.iam.saml2.domain.model.GenericSaml2Id;
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;

public final class Saml2SpInitiatedSloId {
   private final GenericSaml2Id id;

   public static Saml2SpInitiatedSloId parseSpInitiatedSloId(String value) {
      return new Saml2SpInitiatedSloId(GenericSaml2Id.parseId(value));
   }

   public static Saml2SpInitiatedSloId newSpInitiatedSloId() {
      return new Saml2SpInitiatedSloId(GenericSaml2Id.newId());
   }

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

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

   @SuppressFBWarnings(justification = "generated code")
   @Override
   public boolean equals(Object o) {
      if (o == this) {
         return true;
      } else if (!(o instanceof Saml2SpInitiatedSloId 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 Saml2SpInitiatedSloId(GenericSaml2Id id) {
      this.id = id;
   }
}
