package com.airlock.iam.common.domain.model.jwt.encryption;

import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import lombok.NonNull;

public final class JweToken {
   @NonNull
   private final String jwe;

   @SuppressFBWarnings(justification = "generated code")
   private JweToken(@NonNull String jwe) {
      if (jwe == null) {
         throw new NullPointerException("jwe is marked non-null but is null");
      }

      this.jwe = jwe;
   }

   @SuppressFBWarnings(justification = "generated code")
   public static JweToken of(@NonNull String jwe) {
      if (jwe == null) {
         throw new NullPointerException("jwe is marked non-null but is null");
      } else {
         return new JweToken(jwe);
      }
   }

   @NonNull
   @SuppressFBWarnings(justification = "generated code")
   public String getJwe() {
      return this.jwe;
   }

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

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

   @SuppressFBWarnings(justification = "generated code")
   @Override
   public String toString() {
      return "JweToken(jwe=" + this.getJwe() + ")";
   }
}
