package com.airlock.iam.application.parameters.domain.model;

import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import java.nio.file.Path;

public final class IamConfigRoot {
   private static final String INSTANCES_DIRECTORY = "instances";
   private final Path directory;

   public Path resolveInstancesDirectory() {
      return this.directory.resolve("instances").toAbsolutePath().normalize();
   }

   public Path resolveInstanceDirectory(String instanceName) {
      return this.resolveInstancesDirectory().resolve(instanceName);
   }

   @Override
   public String toString() {
      return this.directory.toString();
   }

   @SuppressFBWarnings(justification = "generated code")
   public IamConfigRoot(Path directory) {
      this.directory = directory;
   }

   @SuppressFBWarnings(justification = "generated code")
   public Path directory() {
      return this.directory;
   }

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

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