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

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

public final class BooleanInputGenericTokenUiElement implements GenericTokenUiElement {
   @NonNull
   private final String label;
   @NonNull
   private final String property;
   private final boolean readOnly;

   @SuppressFBWarnings(justification = "generated code")
   BooleanInputGenericTokenUiElement(@NonNull String label, @NonNull String property, boolean readOnly) {
      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.readOnly = readOnly;
   }

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

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

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

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

   @SuppressFBWarnings(justification = "generated code")
   @Override
   public boolean equals(Object o) {
      if (o == this) {
         return true;
      } else if (!(o instanceof BooleanInputGenericTokenUiElement other)) {
         return false;
      } else if (this.readOnly != other.readOnly) {
         return false;
      } else {
         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;
            return this$property == null ? other$property == null : this$property.equals(other$property);
         } else {
            return false;
         }
      }
   }

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

   @SuppressFBWarnings(justification = "generated code")
   @Override
   public String toString() {
      return "BooleanInputGenericTokenUiElement(label=" + this.getLabel() + ", property=" + this.getProperty() + ", readOnly=" + this.isReadOnly() + ")";
   }

   @SuppressFBWarnings(justification = "generated code")
   public static class BooleanInputGenericTokenUiElementBuilder {
      @SuppressFBWarnings(justification = "generated code")
      private String label;
      @SuppressFBWarnings(justification = "generated code")
      private String property;
      @SuppressFBWarnings(justification = "generated code")
      private boolean readOnly;

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

      @SuppressFBWarnings(justification = "generated code")
      public BooleanInputGenericTokenUiElement.BooleanInputGenericTokenUiElementBuilder 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 BooleanInputGenericTokenUiElement.BooleanInputGenericTokenUiElementBuilder 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 BooleanInputGenericTokenUiElement.BooleanInputGenericTokenUiElementBuilder readOnly(boolean readOnly) {
         this.readOnly = readOnly;
         return this;
      }

      @SuppressFBWarnings(justification = "generated code")
      public BooleanInputGenericTokenUiElement build() {
         return new BooleanInputGenericTokenUiElement(this.label, this.property, this.readOnly);
      }

      @SuppressFBWarnings(justification = "generated code")
      @Override
      public String toString() {
         return "BooleanInputGenericTokenUiElement.BooleanInputGenericTokenUiElementBuilder(label="
            + this.label
            + ", property="
            + this.property
            + ", readOnly="
            + this.readOnly
            + ")";
      }
   }
}
