package com.airlock.iam.flow.shared.domain.model.airlock2fa;

import com.airlock.iam.airlock2fa.api.domain.model.Airlock2FADeviceId;
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import lombok.NonNull;

public final class Airlock2FADeviceEditData {
   @NonNull
   private final Airlock2FADeviceId deviceId;
   @NonNull
   private final String displayName;

   @SuppressFBWarnings(justification = "generated code")
   Airlock2FADeviceEditData(@NonNull Airlock2FADeviceId deviceId, @NonNull String displayName) {
      if (deviceId == null) {
         throw new NullPointerException("deviceId is marked non-null but is null");
      }

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

      this.deviceId = deviceId;
      this.displayName = displayName;
   }

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

   @NonNull
   @SuppressFBWarnings(justification = "generated code")
   public Airlock2FADeviceId getDeviceId() {
      return this.deviceId;
   }

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

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

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

   @SuppressFBWarnings(justification = "generated code")
   @Override
   public String toString() {
      return "Airlock2FADeviceEditData(deviceId=" + this.getDeviceId() + ", displayName=" + this.getDisplayName() + ")";
   }

   @SuppressFBWarnings(justification = "generated code")
   public static class Airlock2FADeviceEditDataBuilder {
      @SuppressFBWarnings(justification = "generated code")
      private Airlock2FADeviceId deviceId;
      @SuppressFBWarnings(justification = "generated code")
      private String displayName;

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

      @SuppressFBWarnings(justification = "generated code")
      public Airlock2FADeviceEditData.Airlock2FADeviceEditDataBuilder deviceId(@NonNull Airlock2FADeviceId deviceId) {
         if (deviceId == null) {
            throw new NullPointerException("deviceId is marked non-null but is null");
         }

         this.deviceId = deviceId;
         return this;
      }

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

         this.displayName = displayName;
         return this;
      }

      @SuppressFBWarnings(justification = "generated code")
      public Airlock2FADeviceEditData build() {
         return new Airlock2FADeviceEditData(this.deviceId, this.displayName);
      }

      @SuppressFBWarnings(justification = "generated code")
      @Override
      public String toString() {
         return "Airlock2FADeviceEditData.Airlock2FADeviceEditDataBuilder(deviceId=" + this.deviceId + ", displayName=" + this.displayName + ")";
      }
   }
}
