Package dev.zucca_ops.kustomtrace.model
Class GraphNode
java.lang.Object
dev.zucca_ops.kustomtrace.model.GraphNode
- Direct Known Subclasses:
KustomFile,Kustomization
Abstract base class for nodes in the Kustomize dependency graph.
Represents either a Kustomization file or a Kubernetes resource file.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final CopyOnWriteArrayList<Kustomization>protected Path -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddDependent(Kustomization dependent) Adds a Kustomization that depends on this node.getPath()booleanChecks if the given Kustomization is a direct or indirect root application that this node contributes to.abstract booleanabstract boolean
-
Field Details
-
path
-
dependents
-
-
Constructor Details
-
GraphNode
Constructor to set the path for the graph node.- Parameters:
path- The file system path this node represents.
-
-
Method Details
-
getPath
- Returns:
- The
Pathto the file system entity this node represents.
-
getDependents
- Returns:
- An unmodifiable list of Kustomizations that depend on this node.
-
hasDependent
Checks if the given Kustomization is a direct or indirect root application that this node contributes to.- Parameters:
k- The Kustomization to check.- Returns:
trueif k is an application this node is part of,falseotherwise.
-
addDependent
Adds a Kustomization that depends on this node.- Parameters:
dependent- The Kustomization that depends on this node.
-
isKustomization
public abstract boolean isKustomization()- Returns:
trueif this node represents a Kustomization file.
-
isKustomFile
public abstract boolean isKustomFile()- Returns:
trueif this node represents a regular KustomFile (not a Kustomization).
-