package com.airlock.iam.plugin.framework.misc.config;

import com.airlock.iam.plugin.api.config.ConfigurationContext;
import com.airlock.iam.plugin.api.config.PluginConfiguration;
import com.airlock.iam.plugin.api.property.PropertyConfiguration;
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import lombok.NonNull;

public class PropertyConfigurationWithPluginConfiguration {
   @NonNull
   private final PropertyConfiguration propertyConfiguration;
   @NonNull
   private final PluginConfiguration pluginConfiguration;
   @NonNull
   private final ConfigurationContext configurationContext;

   @SuppressFBWarnings(justification = "generated code")
   public PropertyConfigurationWithPluginConfiguration(
      @NonNull PropertyConfiguration propertyConfiguration,
      @NonNull PluginConfiguration pluginConfiguration,
      @NonNull ConfigurationContext configurationContext
   ) {
      if (propertyConfiguration == null) {
         throw new NullPointerException("propertyConfiguration is marked non-null but is null");
      }

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

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

      this.propertyConfiguration = propertyConfiguration;
      this.pluginConfiguration = pluginConfiguration;
      this.configurationContext = configurationContext;
   }

   @NonNull
   @SuppressFBWarnings(justification = "generated code")
   public PropertyConfiguration getPropertyConfiguration() {
      return this.propertyConfiguration;
   }

   @NonNull
   @SuppressFBWarnings(justification = "generated code")
   public PluginConfiguration getPluginConfiguration() {
      return this.pluginConfiguration;
   }

   @NonNull
   @SuppressFBWarnings(justification = "generated code")
   public ConfigurationContext getConfigurationContext() {
      return this.configurationContext;
   }
}
