package com.airlock.iam.plugin.framework.domain.model;

import com.airlock.iam.plugin.api.config.ConfigurationContext;
import com.airlock.iam.plugin.api.config.ConfigurationEnvironment;
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;

public final class PropertyIdentifier {
   private final String name;
   private final ConfigurationEnvironment environment;
   private final ConfigurationContext context;

   @SuppressFBWarnings(justification = "generated code")
   private PropertyIdentifier(String name, ConfigurationEnvironment environment, ConfigurationContext context) {
      this.name = name;
      this.environment = environment;
      this.context = context;
   }

   @SuppressFBWarnings(justification = "generated code")
   public static PropertyIdentifier by(String name, ConfigurationEnvironment environment, ConfigurationContext context) {
      return new PropertyIdentifier(name, environment, context);
   }

   @SuppressFBWarnings(justification = "generated code")
   public String getName() {
      return this.name;
   }

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

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

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

   @SuppressFBWarnings(justification = "generated code")
   @Override
   public int hashCode() {
      int PRIME = 59;
      int result = 1;
      Object $name = this.name;
      result = result * 59 + ($name == null ? 43 : $name.hashCode());
      Object $environment = this.environment;
      result = result * 59 + ($environment == null ? 43 : $environment.hashCode());
      Object $context = this.context;
      return result * 59 + ($context == null ? 43 : $context.hashCode());
   }

   @SuppressFBWarnings(justification = "generated code")
   @Override
   public String toString() {
      return "PropertyIdentifier(name=" + this.getName() + ", environment=" + this.getEnvironment() + ", context=" + this.getContext() + ")";
   }
}
