Package dev.zucca_ops.kustomtrace.model
Class Kustomization
java.lang.Object
dev.zucca_ops.kustomtrace.model.GraphNode
dev.zucca_ops.kustomtrace.model.Kustomization
Represents a Kustomization (typically a kustomization.yaml file) as a node
in the Kustomize dependency graph. It holds its own content and references
to other graph nodes.
-
Field Summary
Fields inherited from class dev.zucca_ops.kustomtrace.model.GraphNode
dependents, path -
Constructor Summary
ConstructorsConstructorDescriptionKustomization(Path path, Map<String, Object> content) Constructs a Kustomization node. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddReference(ResourceReference reference) Adds a resolved reference to another graph node.getApps()Retrieves all "root" Kustomizations that this Kustomization contributes to.Returns the parsed content (YAML map) of this kustomization file.Retrieves all file dependencies for this Kustomization.Provides a display name for this Kustomization, typically its kind and path.getKind()Returns the kind of this graph node.Gets the list of resolved references to other graph nodes.booleanIndicates that this node is not a KustomFile.booleanIndicates that this node is a Kustomization.booleanisRoot()Determines if this Kustomization is a root node (i.e., no other Kustomizations depend on it).Methods inherited from class dev.zucca_ops.kustomtrace.model.GraphNode
addDependent, getDependents, getPath, hasDependent
-
Constructor Details
-
Kustomization
Constructs a Kustomization node.- Parameters:
path- The file system path to this kustomization file.content- The parsed YAML content of this kustomization file.
-
-
Method Details
-
getContent
Returns the parsed content (YAML map) of this kustomization file.- Returns:
- The raw content map.
-
addReference
Adds a resolved reference to another graph node.- Parameters:
reference- TheResourceReferenceto add.
-
getReferences
Gets the list of resolved references to other graph nodes.- Returns:
- An unmodifiable list of
ResourceReferences.
-
getKind
Returns the kind of this graph node.- Returns:
- Always "Kustomization" for this class.
-
isRoot
public boolean isRoot()Determines if this Kustomization is a root node (i.e., no other Kustomizations depend on it).- Returns:
trueif this Kustomization has no dependents,falseotherwise.
-
getDisplayName
Provides a display name for this Kustomization, typically its kind and path.- Returns:
- A string representation for display purposes.
-
isKustomization
public boolean isKustomization()Indicates that this node is a Kustomization.- Specified by:
isKustomizationin classGraphNode- Returns:
- Always
true.
-
isKustomFile
public boolean isKustomFile()Indicates that this node is not a KustomFile.- Specified by:
isKustomFilein classGraphNode- Returns:
- Always
false.
-
getDependencies
Retrieves all file dependencies for this Kustomization.- Returns:
- A stream of unique
Paths this Kustomization depends on.
-
getApps
Retrieves all "root" Kustomizations that this Kustomization contributes to.- Returns:
- A stream of root
Kustomizations.
-