package com.airlock.iam.flow.api.domain.model.redflag;

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

public final class RedFlag {
   @NonNull
   private final String name;

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

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

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

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

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

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

      this.name = name;
   }

   @SuppressFBWarnings(justification = "generated code")
   public static class RedFlagBuilder {
      @SuppressFBWarnings(justification = "generated code")
      private String name;

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

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

         this.name = name;
         return this;
      }

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

      @SuppressFBWarnings(justification = "generated code")
      @Override
      public String toString() {
         return "RedFlag.RedFlagBuilder(name=" + this.name + ")";
      }
   }
}
