package com.airlock.iam.common.domain.model.valueprovider;

import com.airlock.iam.base.api.domain.model.plugin.LogicForConfig;
import com.airlock.iam.common.api.domain.model.valueprovider.ValueProvider;
import com.airlock.iam.common.application.configuration.valueprovider.BooleanStaticValueProviderConfig;
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import jakarta.inject.Inject;

@LogicForConfig(BooleanStaticValueProviderConfig.class)
public final class BooleanStaticValueProvider implements ValueProvider<Boolean> {
   private BooleanStaticValueProviderConfig config;

   @Inject
   public BooleanStaticValueProvider(BooleanStaticValueProviderConfig config) {
      this.config = config;
   }

   public Boolean getValue() {
      return this.config.isValue();
   }

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

   @SuppressFBWarnings(justification = "generated code")
   public static class BooleanStaticValueProviderBuilder {
      @SuppressFBWarnings(justification = "generated code")
      private BooleanStaticValueProviderConfig config;

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

      @SuppressFBWarnings(justification = "generated code")
      public BooleanStaticValueProvider.BooleanStaticValueProviderBuilder config(BooleanStaticValueProviderConfig config) {
         this.config = config;
         return this;
      }

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

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