Class KustomResource

java.lang.Object
dev.zucca_ops.kustomtrace.model.KustomResource

public class KustomResource extends Object
Represents a single Kubernetes resource (e.g., Deployment, Service) defined within a KustomFile.
  • Constructor Details

    • KustomResource

      public KustomResource()
      Default constructor. Name, kind, and file should be set via setters or a parameterized constructor.
    • KustomResource

      public KustomResource(String name, String kind, KustomFile file)
      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 - The KustomFile this resource was parsed from.
  • Method Details

    • getKind

      public String getKind()
      Returns:
      The kind of the Kubernetes resource (e.g., "Deployment", "Service"). May be null if not set or not found during parsing.
    • setKind

      public void setKind(String kind)
      Sets the kind of this Kubernetes resource.
      Parameters:
      kind - The resource kind.
    • setName

      public void setName(String name)
      Sets the name of this Kubernetes resource.
      Parameters:
      name - The resource name.
    • setFile

      public void setFile(KustomFile file)
      Sets the KustomFile that contains this resource.
      Parameters:
      file - The parent KustomFile.
    • getDisplayName

      public String 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

      public String getName()
      Returns:
      The name of the Kubernetes resource (from metadata.name). Returns "undefined" if the name is null.
    • getFile

      public KustomFile getFile()
      Returns:
      The KustomFile that contains this resource. May be null if not set.
    • toString

      public String toString()
      Overrides:
      toString in class Object