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

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

public final class Saml2SignatureAlgorithm {
   private final String sigAlg;

   private Saml2SignatureAlgorithm(@NonNull String sigAlg) {
      if (sigAlg == null) {
         throw new NullPointerException("sigAlg is marked non-null but is null");
      }

      Validate.notBlank(sigAlg);
      this.sigAlg = sigAlg;
   }

   public static Saml2SignatureAlgorithm signatureAlgorithm(String sigAlg) {
      return new Saml2SignatureAlgorithm(sigAlg);
   }

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

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

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

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