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

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

public final class Saml2AuthenticationContextClassRef {
   private final String id;

   private Saml2AuthenticationContextClassRef(String id) {
      Validate.notBlank(id);
      this.id = id;
   }

   public static Saml2AuthenticationContextClassRef authenticationContext(String id) {
      return new Saml2AuthenticationContextClassRef(id);
   }

   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 Saml2AuthenticationContextClassRef 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());
   }
}
