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

import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import jakarta.annotation.Nullable;
import lombok.NonNull;

public final class DateTimeInputGenericTokenUiElement implements GenericTokenUiElement {
   @NonNull
   private final String label;
   @NonNull
   private final String property;
   @Nullable
   private final String placeholder;
   private final boolean required;
   private final boolean dateOnly;
   private final boolean readOnly;
   private final boolean hideIfEmpty;

   @SuppressFBWarnings(justification = "generated code")
   DateTimeInputGenericTokenUiElement(
      @NonNull String label, @NonNull String property, @Nullable String placeholder, boolean required, boolean dateOnly, boolean readOnly, boolean hideIfEmpty
   ) {
      if (label == null) {
         throw new NullPointerException("label is marked non-null but is null");
      }

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

      this.label = label;
      this.property = property;
      this.placeholder = placeholder;
      this.required = required;
      this.dateOnly = dateOnly;
      this.readOnly = readOnly;
      this.hideIfEmpty = hideIfEmpty;
   }

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

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

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

   @Nullable
   @SuppressFBWarnings(justification = "generated code")
   public String getPlaceholder() {
      return this.placeholder;
   }

   @SuppressFBWarnings(justification = "generated code")
   public boolean isRequired() {
      return this.required;
   }

   @SuppressFBWarnings(justification = "generated code")
   public boolean isDateOnly() {
      return this.dateOnly;
   }

   @SuppressFBWarnings(justification = "generated code")
   public boolean isReadOnly() {
      return this.readOnly;
   }

   @SuppressFBWarnings(justification = "generated code")
   public boolean isHideIfEmpty() {
      return this.hideIfEmpty;
   }

   @SuppressFBWarnings(justification = "generated code")
   @Override
   public boolean equals(Object o) {
      if (o == this) {
         return true;
      } else if (!(o instanceof DateTimeInputGenericTokenUiElement other)) {
         return false;
      } else {
         if (this.required != other.required) {
            return false;
         }

         if (this.dateOnly != other.dateOnly) {
            return false;
         }

         if (this.readOnly != other.readOnly) {
            return false;
         }

         if (this.hideIfEmpty != other.hideIfEmpty) {
            return false;
         }

         Object this$label = this.label;
         Object other$label = other.label;
         if (this$label == null ? other$label == null : this$label.equals(other$label)) {
            Object this$property = this.property;
            Object other$property = other.property;
            if (this$property == null ? other$property == null : this$property.equals(other$property)) {
               Object this$placeholder = this.placeholder;
               Object other$placeholder = other.placeholder;
               return this$placeholder == null ? other$placeholder == null : this$placeholder.equals(other$placeholder);
            } else {
               return false;
            }
         } else {
            return false;
         }
      }
   }

   @SuppressFBWarnings(justification = "generated code")
   @Override
   public int hashCode() {
      int PRIME = 59;
      int result = 1;
      result = result * 59 + (this.required ? 79 : 97);
      result = result * 59 + (this.dateOnly ? 79 : 97);
      result = result * 59 + (this.readOnly ? 79 : 97);
      result = result * 59 + (this.hideIfEmpty ? 79 : 97);
      Object $label = this.label;
      result = result * 59 + ($label == null ? 43 : $label.hashCode());
      Object $property = this.property;
      result = result * 59 + ($property == null ? 43 : $property.hashCode());
      Object $placeholder = this.placeholder;
      return result * 59 + ($placeholder == null ? 43 : $placeholder.hashCode());
   }

   @SuppressFBWarnings(justification = "generated code")
   @Override
   public String toString() {
      return "DateTimeInputGenericTokenUiElement(label="
         + this.getLabel()
         + ", property="
         + this.getProperty()
         + ", placeholder="
         + this.getPlaceholder()
         + ", required="
         + this.isRequired()
         + ", dateOnly="
         + this.isDateOnly()
         + ", readOnly="
         + this.isReadOnly()
         + ", hideIfEmpty="
         + this.isHideIfEmpty()
         + ")";
   }

   @SuppressFBWarnings(justification = "generated code")
   public static class DateTimeInputGenericTokenUiElementBuilder {
      @SuppressFBWarnings(justification = "generated code")
      private String label;
      @SuppressFBWarnings(justification = "generated code")
      private String property;
      @SuppressFBWarnings(justification = "generated code")
      private String placeholder;
      @SuppressFBWarnings(justification = "generated code")
      private boolean required;
      @SuppressFBWarnings(justification = "generated code")
      private boolean dateOnly;
      @SuppressFBWarnings(justification = "generated code")
      private boolean readOnly;
      @SuppressFBWarnings(justification = "generated code")
      private boolean hideIfEmpty;

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

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

         this.label = label;
         return this;
      }

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

         this.property = property;
         return this;
      }

      @SuppressFBWarnings(justification = "generated code")
      public DateTimeInputGenericTokenUiElement.DateTimeInputGenericTokenUiElementBuilder placeholder(@Nullable String placeholder) {
         this.placeholder = placeholder;
         return this;
      }

      @SuppressFBWarnings(justification = "generated code")
      public DateTimeInputGenericTokenUiElement.DateTimeInputGenericTokenUiElementBuilder required(boolean required) {
         this.required = required;
         return this;
      }

      @SuppressFBWarnings(justification = "generated code")
      public DateTimeInputGenericTokenUiElement.DateTimeInputGenericTokenUiElementBuilder dateOnly(boolean dateOnly) {
         this.dateOnly = dateOnly;
         return this;
      }

      @SuppressFBWarnings(justification = "generated code")
      public DateTimeInputGenericTokenUiElement.DateTimeInputGenericTokenUiElementBuilder readOnly(boolean readOnly) {
         this.readOnly = readOnly;
         return this;
      }

      @SuppressFBWarnings(justification = "generated code")
      public DateTimeInputGenericTokenUiElement.DateTimeInputGenericTokenUiElementBuilder hideIfEmpty(boolean hideIfEmpty) {
         this.hideIfEmpty = hideIfEmpty;
         return this;
      }

      @SuppressFBWarnings(justification = "generated code")
      public DateTimeInputGenericTokenUiElement build() {
         return new DateTimeInputGenericTokenUiElement(
            this.label, this.property, this.placeholder, this.required, this.dateOnly, this.readOnly, this.hideIfEmpty
         );
      }

      @SuppressFBWarnings(justification = "generated code")
      @Override
      public String toString() {
         return "DateTimeInputGenericTokenUiElement.DateTimeInputGenericTokenUiElementBuilder(label="
            + this.label
            + ", property="
            + this.property
            + ", placeholder="
            + this.placeholder
            + ", required="
            + this.required
            + ", dateOnly="
            + this.dateOnly
            + ", readOnly="
            + this.readOnly
            + ", hideIfEmpty="
            + this.hideIfEmpty
            + ")";
      }
   }
}
