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

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

public final class TextMessageGenericTokenUiElement implements GenericTokenUiElement {
   @NonNull
   private final String message;
   @NonNull
   private final MessageUiElementType type;

   @SuppressFBWarnings(justification = "generated code")
   TextMessageGenericTokenUiElement(@NonNull String message, @NonNull MessageUiElementType type) {
      if (message == null) {
         throw new NullPointerException("message is marked non-null but is null");
      }

      if (type == null) {
         throw new NullPointerException("type is marked non-null but is null");
      }

      this.message = message;
      this.type = type;
   }

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

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

   @NonNull
   @SuppressFBWarnings(justification = "generated code")
   public MessageUiElementType getType() {
      return this.type;
   }

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

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

   @SuppressFBWarnings(justification = "generated code")
   @Override
   public String toString() {
      return "TextMessageGenericTokenUiElement(message=" + this.getMessage() + ", type=" + this.getType() + ")";
   }

   @SuppressFBWarnings(justification = "generated code")
   public static class TextMessageGenericTokenUiElementBuilder {
      @SuppressFBWarnings(justification = "generated code")
      private String message;
      @SuppressFBWarnings(justification = "generated code")
      private MessageUiElementType type;

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

      @SuppressFBWarnings(justification = "generated code")
      public TextMessageGenericTokenUiElement.TextMessageGenericTokenUiElementBuilder message(@NonNull String message) {
         if (message == null) {
            throw new NullPointerException("message is marked non-null but is null");
         }

         this.message = message;
         return this;
      }

      @SuppressFBWarnings(justification = "generated code")
      public TextMessageGenericTokenUiElement.TextMessageGenericTokenUiElementBuilder type(@NonNull MessageUiElementType type) {
         if (type == null) {
            throw new NullPointerException("type is marked non-null but is null");
         }

         this.type = type;
         return this;
      }

      @SuppressFBWarnings(justification = "generated code")
      public TextMessageGenericTokenUiElement build() {
         return new TextMessageGenericTokenUiElement(this.message, this.type);
      }

      @SuppressFBWarnings(justification = "generated code")
      @Override
      public String toString() {
         return "TextMessageGenericTokenUiElement.TextMessageGenericTokenUiElementBuilder(message=" + this.message + ", type=" + this.type + ")";
      }
   }
}
