package com.airlock.iam.common.domain.model.sms;

import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import java.util.Optional;
import org.apache.commons.lang3.StringUtils;

public final class SmsMessageId {
   private final Optional<String> id;

   public boolean exists() {
      return this.id.isPresent() && !StringUtils.isBlank(this.id.get());
   }

   public String getId() throws IllegalStateException {
      return this.id.get();
   }

   @SuppressFBWarnings(justification = "generated code")
   SmsMessageId(Optional<String> id) {
      this.id = id;
   }

   @SuppressFBWarnings(justification = "generated code")
   public static SmsMessageId.SmsMessageIdBuilder builder() {
      return new SmsMessageId.SmsMessageIdBuilder();
   }

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

   @SuppressFBWarnings(justification = "generated code")
   public static class SmsMessageIdBuilder {
      @SuppressFBWarnings(justification = "generated code")
      private Optional<String> id;

      @SuppressFBWarnings(justification = "generated code")
      SmsMessageIdBuilder() {
      }

      @SuppressFBWarnings(justification = "generated code")
      public SmsMessageId.SmsMessageIdBuilder id(Optional<String> id) {
         this.id = id;
         return this;
      }

      @SuppressFBWarnings(justification = "generated code")
      public SmsMessageId build() {
         return new SmsMessageId(this.id);
      }

      @SuppressFBWarnings(justification = "generated code")
      @Override
      public String toString() {
         return "SmsMessageId.SmsMessageIdBuilder(id=" + this.id + ")";
      }
   }
}
