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.IntegerStaticValueProviderConfig;
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import jakarta.inject.Inject;

@LogicForConfig(IntegerStaticValueProviderConfig.class)
public final class IntegerStaticValueProvider implements ValueProvider<Integer> {
   private IntegerStaticValueProviderConfig config;

   @Inject
   public IntegerStaticValueProvider(IntegerStaticValueProviderConfig config) {
      this.config = config;
   }

   public Integer getValue() {
      return this.config.getValue();
   }

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

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

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

      @SuppressFBWarnings(justification = "generated code")
      public IntegerStaticValueProvider.IntegerStaticValueProviderBuilder config(IntegerStaticValueProviderConfig config) {
         this.config = config;
         return this;
      }

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

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