package com.airlock.iam.admin.application.service.token.vasco;

import com.airlock.iam.core.misc.persistency.token.TokenDataProvider;
import com.airlock.iam.core.misc.util.vasco.VascoHandler;
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;

public final class VascoLicenseSettings {
   private final VascoHandler vascoHandler;
   private final TokenDataProvider tokenDataProvider;
   private final boolean enableImportedTokens;

   @SuppressFBWarnings(justification = "generated code")
   VascoLicenseSettings(VascoHandler vascoHandler, TokenDataProvider tokenDataProvider, boolean enableImportedTokens) {
      this.vascoHandler = vascoHandler;
      this.tokenDataProvider = tokenDataProvider;
      this.enableImportedTokens = enableImportedTokens;
   }

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

   @SuppressFBWarnings(justification = "generated code")
   public VascoHandler getVascoHandler() {
      return this.vascoHandler;
   }

   @SuppressFBWarnings(justification = "generated code")
   public TokenDataProvider getTokenDataProvider() {
      return this.tokenDataProvider;
   }

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

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

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

   @SuppressFBWarnings(justification = "generated code")
   @Override
   public String toString() {
      return "VascoLicenseSettings(vascoHandler="
         + this.getVascoHandler()
         + ", tokenDataProvider="
         + this.getTokenDataProvider()
         + ", enableImportedTokens="
         + this.isEnableImportedTokens()
         + ")";
   }

   @SuppressFBWarnings(justification = "generated code")
   public static class VascoLicenseSettingsBuilder {
      @SuppressFBWarnings(justification = "generated code")
      private VascoHandler vascoHandler;
      @SuppressFBWarnings(justification = "generated code")
      private TokenDataProvider tokenDataProvider;
      @SuppressFBWarnings(justification = "generated code")
      private boolean enableImportedTokens;

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

      @SuppressFBWarnings(justification = "generated code")
      public VascoLicenseSettings.VascoLicenseSettingsBuilder vascoHandler(VascoHandler vascoHandler) {
         this.vascoHandler = vascoHandler;
         return this;
      }

      @SuppressFBWarnings(justification = "generated code")
      public VascoLicenseSettings.VascoLicenseSettingsBuilder tokenDataProvider(TokenDataProvider tokenDataProvider) {
         this.tokenDataProvider = tokenDataProvider;
         return this;
      }

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

      @SuppressFBWarnings(justification = "generated code")
      public VascoLicenseSettings build() {
         return new VascoLicenseSettings(this.vascoHandler, this.tokenDataProvider, this.enableImportedTokens);
      }

      @SuppressFBWarnings(justification = "generated code")
      @Override
      public String toString() {
         return "VascoLicenseSettings.VascoLicenseSettingsBuilder(vascoHandler="
            + this.vascoHandler
            + ", tokenDataProvider="
            + this.tokenDataProvider
            + ", enableImportedTokens="
            + this.enableImportedTokens
            + ")";
      }
   }
}
