Package dev.zucca_ops.kustomtrace.model
Class KustomResource
java.lang.Object
dev.zucca_ops.kustomtrace.model.KustomResource
Represents a single Kubernetes resource (e.g., Deployment, Service)
defined within a
KustomFile.-
Constructor Summary
ConstructorsConstructorDescriptionDefault constructor.KustomResource(String name, String kind, KustomFile file) Constructs a KustomResource with specified name, kind, and containing file. -
Method Summary
Modifier and TypeMethodDescriptionGenerates a display name for the resource, combining its kind, name, and file path.getFile()getKind()getName()voidsetFile(KustomFile file) Sets theKustomFilethat contains this resource.voidSets the kind of this Kubernetes resource.voidSets the name of this Kubernetes resource.toString()
-
Constructor Details
-
KustomResource
public KustomResource()Default constructor. Name, kind, and file should be set via setters or a parameterized constructor. -
KustomResource
Constructs a KustomResource with specified name, kind, and containing file.- Parameters:
name- The name of the Kubernetes resource (from metadata.name).kind- The kind of the Kubernetes resource (e.g., Deployment, Service).file- TheKustomFilethis resource was parsed from.
-
-
Method Details
-
getKind
- Returns:
- The kind of the Kubernetes resource (e.g., "Deployment", "Service"). May be null if not set or not found during parsing.
-
setKind
Sets the kind of this Kubernetes resource.- Parameters:
kind- The resource kind.
-
setName
Sets the name of this Kubernetes resource.- Parameters:
name- The resource name.
-
setFile
Sets theKustomFilethat contains this resource.- Parameters:
file- The parent KustomFile.
-
getDisplayName
Generates a display name for the resource, combining its kind, name, and file path. Uses forward slashes for path separators.- Returns:
- A string suitable for display.
-
getName
- Returns:
- The name of the Kubernetes resource (from metadata.name). Returns "undefined" if the name is null.
-
getFile
- Returns:
- The
KustomFilethat contains this resource. May be null if not set.
-
toString
-