package com.airlock.iam.admin.domain.model.token.airlock2fa;

import com.airlock.iam.base.api.domain.model.identity.Identity;
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import java.util.UUID;
import lombok.NonNull;

public final class Airlock2FAShipmentLetterId implements Identity<Airlock2FAShipmentLetter> {
   @NonNull
   private final String id;

   static Airlock2FAShipmentLetterId airlock2FAShipmentLetterId(String id) {
      return new Airlock2FAShipmentLetterId(id);
   }

   static Airlock2FAShipmentLetterId generateAirlock2FAActivationLetterId() {
      return new Airlock2FAShipmentLetterId(UUID.randomUUID().toString());
   }

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

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

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

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

      this.id = id;
   }
}
