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

import com.airlock.iam.plugin.api.config.ConfigurationContext;
import com.airlock.iam.plugin.api.config.ConfigurationEnvironment;
import com.airlock.iam.plugin.api.property.PropertyConfiguration;
import com.airlock.iam.plugin.framework.application.configuration.MutablePluginConfiguration;
import com.google.common.base.Preconditions;
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;

public class PluginConfigurationPropertyChangedEvent extends PluginConfigurationChangedEvent {
   private final ConfigurationEnvironment environment;
   private final ConfigurationContext context;
   private final PropertyConfiguration oldValue;
   private final PropertyConfiguration newValue;

   public PluginConfigurationPropertyChangedEvent(
      MutablePluginConfiguration pluginConfiguration,
      ConfigurationEnvironment env,
      ConfigurationContext context,
      PropertyConfiguration oldValue,
      PropertyConfiguration newValue
   ) {
      super(pluginConfiguration);
      this.environment = (ConfigurationEnvironment)Preconditions.checkNotNull(env);
      this.context = (ConfigurationContext)Preconditions.checkNotNull(context);
      this.oldValue = oldValue;
      this.newValue = newValue;
   }

   @SuppressFBWarnings(justification = "generated code")
   public ConfigurationEnvironment getEnvironment() {
      return this.environment;
   }

   @SuppressFBWarnings(justification = "generated code")
   public ConfigurationContext getContext() {
      return this.context;
   }

   @SuppressFBWarnings(justification = "generated code")
   public PropertyConfiguration getOldValue() {
      return this.oldValue;
   }

   @SuppressFBWarnings(justification = "generated code")
   public PropertyConfiguration getNewValue() {
      return this.newValue;
   }
}
