package com.airlock.iam.application.parameters.domain.model;

import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import java.net.URI;
import java.nio.file.Path;
import java.util.Objects;

public final class H2Parameters {
   private final String urlPath;
   private final Path dataDir;
   private final URI jdbcUrl;
   private final String user;
   private final String password;
   private final boolean skipAdminPasswordChange;

   public H2Parameters(String urlPath, Path dataDir, URI jdbcUrl, String user, String password, boolean skipAdminPasswordChange) {
      this.urlPath = Objects.requireNonNull(urlPath);
      this.dataDir = Objects.requireNonNull(dataDir);
      this.jdbcUrl = Objects.requireNonNull(jdbcUrl);
      this.user = Objects.requireNonNull(user);
      this.password = Objects.requireNonNull(password);
      this.skipAdminPasswordChange = skipAdminPasswordChange;
   }

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

   @SuppressFBWarnings(justification = "generated code")
   public Path dataDir() {
      return this.dataDir;
   }

   @SuppressFBWarnings(justification = "generated code")
   public URI jdbcUrl() {
      return this.jdbcUrl;
   }

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

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

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

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

         Object this$urlPath = this.urlPath;
         Object other$urlPath = other.urlPath;
         if (this$urlPath == null ? other$urlPath == null : this$urlPath.equals(other$urlPath)) {
            Object this$dataDir = this.dataDir;
            Object other$dataDir = other.dataDir;
            if (this$dataDir == null ? other$dataDir == null : this$dataDir.equals(other$dataDir)) {
               Object this$jdbcUrl = this.jdbcUrl;
               Object other$jdbcUrl = other.jdbcUrl;
               if (this$jdbcUrl == null ? other$jdbcUrl == null : this$jdbcUrl.equals(other$jdbcUrl)) {
                  Object this$user = this.user;
                  Object other$user = other.user;
                  if (this$user == null ? other$user == null : this$user.equals(other$user)) {
                     Object this$password = this.password;
                     Object other$password = other.password;
                     return this$password == null ? other$password == null : this$password.equals(other$password);
                  } else {
                     return false;
                  }
               } else {
                  return false;
               }
            } else {
               return false;
            }
         } else {
            return false;
         }
      }
   }

   @SuppressFBWarnings(justification = "generated code")
   @Override
   public int hashCode() {
      int PRIME = 59;
      int result = 1;
      result = result * 59 + (this.skipAdminPasswordChange ? 79 : 97);
      Object $urlPath = this.urlPath;
      result = result * 59 + ($urlPath == null ? 43 : $urlPath.hashCode());
      Object $dataDir = this.dataDir;
      result = result * 59 + ($dataDir == null ? 43 : $dataDir.hashCode());
      Object $jdbcUrl = this.jdbcUrl;
      result = result * 59 + ($jdbcUrl == null ? 43 : $jdbcUrl.hashCode());
      Object $user = this.user;
      result = result * 59 + ($user == null ? 43 : $user.hashCode());
      Object $password = this.password;
      return result * 59 + ($password == null ? 43 : $password.hashCode());
   }

   @SuppressFBWarnings(justification = "generated code")
   @Override
   public String toString() {
      return "H2Parameters(urlPath="
         + this.urlPath()
         + ", dataDir="
         + this.dataDir()
         + ", jdbcUrl="
         + this.jdbcUrl()
         + ", user="
         + this.user()
         + ", password="
         + this.password()
         + ", skipAdminPasswordChange="
         + this.skipAdminPasswordChange()
         + ")";
   }
}
