package com.airlock.iam.publicselfservice.infrastructure.service.ui;

import com.airlock.iam.flow.ui.infrastructure.settings.UiSettings;
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import java.util.Optional;
import lombok.NonNull;

public final class OnCompletedPublicSelfServiceSettings implements UiSettings {
   private final boolean showConfirmationPage;
   @NonNull
   private final Optional<String> targetUri;
   @NonNull
   private final Optional<String> uiTenantId;

   @SuppressFBWarnings(justification = "generated code")
   OnCompletedPublicSelfServiceSettings(boolean showConfirmationPage, @NonNull Optional<String> targetUri, @NonNull Optional<String> uiTenantId) {
      if (targetUri == null) {
         throw new NullPointerException("targetUri is marked non-null but is null");
      }

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

      this.showConfirmationPage = showConfirmationPage;
      this.targetUri = targetUri;
      this.uiTenantId = uiTenantId;
   }

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

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

   @NonNull
   @SuppressFBWarnings(justification = "generated code")
   public Optional<String> getTargetUri() {
      return this.targetUri;
   }

   @NonNull
   @SuppressFBWarnings(justification = "generated code")
   public Optional<String> getUiTenantId() {
      return this.uiTenantId;
   }

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

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

   @SuppressFBWarnings(justification = "generated code")
   @Override
   public String toString() {
      return "OnCompletedPublicSelfServiceSettings(showConfirmationPage="
         + this.isShowConfirmationPage()
         + ", targetUri="
         + this.getTargetUri()
         + ", uiTenantId="
         + this.getUiTenantId()
         + ")";
   }

   @SuppressFBWarnings(justification = "generated code")
   public static class OnCompletedPublicSelfServiceSettingsBuilder {
      @SuppressFBWarnings(justification = "generated code")
      private boolean showConfirmationPage;
      @SuppressFBWarnings(justification = "generated code")
      private Optional<String> targetUri;
      @SuppressFBWarnings(justification = "generated code")
      private Optional<String> uiTenantId;

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

      @SuppressFBWarnings(justification = "generated code")
      public OnCompletedPublicSelfServiceSettings.OnCompletedPublicSelfServiceSettingsBuilder showConfirmationPage(boolean showConfirmationPage) {
         this.showConfirmationPage = showConfirmationPage;
         return this;
      }

      @SuppressFBWarnings(justification = "generated code")
      public OnCompletedPublicSelfServiceSettings.OnCompletedPublicSelfServiceSettingsBuilder targetUri(@NonNull Optional<String> targetUri) {
         if (targetUri == null) {
            throw new NullPointerException("targetUri is marked non-null but is null");
         }

         this.targetUri = targetUri;
         return this;
      }

      @SuppressFBWarnings(justification = "generated code")
      public OnCompletedPublicSelfServiceSettings.OnCompletedPublicSelfServiceSettingsBuilder uiTenantId(@NonNull Optional<String> uiTenantId) {
         if (uiTenantId == null) {
            throw new NullPointerException("uiTenantId is marked non-null but is null");
         }

         this.uiTenantId = uiTenantId;
         return this;
      }

      @SuppressFBWarnings(justification = "generated code")
      public OnCompletedPublicSelfServiceSettings build() {
         return new OnCompletedPublicSelfServiceSettings(this.showConfirmationPage, this.targetUri, this.uiTenantId);
      }

      @SuppressFBWarnings(justification = "generated code")
      @Override
      public String toString() {
         return "OnCompletedPublicSelfServiceSettings.OnCompletedPublicSelfServiceSettingsBuilder(showConfirmationPage="
            + this.showConfirmationPage
            + ", targetUri="
            + this.targetUri
            + ", uiTenantId="
            + this.uiTenantId
            + ")";
      }
   }
}
