package com.airlock.iam.plugin.configeditor.data.tree;

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

public class PropertyTreeItem extends LabelTreeItem {
   private final PropertyConfiguration propertyConfiguration;

   public PropertyTreeItem(PropertyConfiguration propertyConfiguration, ConfigurationContext context, String displayName, TreeItem<?> parentIdentifier) {
      super(displayName, parentIdentifier, context);
      this.propertyConfiguration = propertyConfiguration;
   }

   @SuppressFBWarnings(justification = "generated code")
   @Override
   public boolean equals(Object o) {
      if (o == this) {
         return true;
      } else if (!(o instanceof PropertyTreeItem other)) {
         return false;
      } else {
         if (!other.canEqual(this)) {
            return false;
         }

         if (!super.equals(o)) {
            return false;
         }

         Object this$propertyConfiguration = this.propertyConfiguration;
         Object other$propertyConfiguration = other.propertyConfiguration;
         return this$propertyConfiguration == null ? other$propertyConfiguration == null : this$propertyConfiguration.equals(other$propertyConfiguration);
      }
   }

   @SuppressFBWarnings(justification = "generated code")
   protected boolean canEqual(Object other) {
      return other instanceof PropertyTreeItem;
   }

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

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