Class GraphNode

java.lang.Object
dev.zucca_ops.kustomtrace.model.GraphNode
Direct Known Subclasses:
KustomFile, Kustomization

public abstract class GraphNode extends Object
Abstract base class for nodes in the Kustomize dependency graph. Represents either a Kustomization file or a Kubernetes resource file.
  • Field Details

  • Constructor Details

    • GraphNode

      protected GraphNode(Path path)
      Constructor to set the path for the graph node.
      Parameters:
      path - The file system path this node represents.
  • Method Details

    • getPath

      public Path getPath()
      Returns:
      The Path to the file system entity this node represents.
    • getDependents

      public List<Kustomization> getDependents()
      Returns:
      An unmodifiable list of Kustomizations that depend on this node.
    • hasDependent

      public boolean hasDependent(Kustomization k)
      Checks if the given Kustomization is a direct or indirect root application that this node contributes to.
      Parameters:
      k - The Kustomization to check.
      Returns:
      true if k is an application this node is part of, false otherwise.
    • addDependent

      public void addDependent(Kustomization dependent)
      Adds a Kustomization that depends on this node.
      Parameters:
      dependent - The Kustomization that depends on this node.
    • isKustomization

      public abstract boolean isKustomization()
      Returns:
      true if this node represents a Kustomization file.
    • isKustomFile

      public abstract boolean isKustomFile()
      Returns:
      true if this node represents a regular KustomFile (not a Kustomization).