Class JsonStateSection

java.lang.Object
com.scivicslab.actoriac.report.sections.basic.JsonStateSection
All Implemented Interfaces:
SectionBuilder

public class JsonStateSection extends Object implements SectionBuilder
POJO section builder that outputs an actor's JsonState in YAML format.

Pure business logic - no CallableByActionName. Use JsonStateSectionIIAR to expose as an actor.

Any IIActorRef can hold JsonState data. This section builder retrieves that data and outputs it in human-readable YAML format.

Output example:

[JsonState: nodeGroup]
cluster:
  name: production
  nodes:
    - hostname: server1
      cpu: 8
      memory: 32Gi
    - hostname: server2
      cpu: 16
      memory: 64Gi
Since:
2.16.0
Author:
devteam@scivicslab.com
  • Field Details

  • Constructor Details

  • Method Details

    • setActorName

      public void setActorName(String actorName)
      Sets the actor name (for display in title).
      Parameters:
      actorName - the actor name
    • setYamlContent

      public void setYamlContent(String yamlContent)
      Sets the YAML content to output.
      Parameters:
      yamlContent - the YAML-formatted JsonState content
    • setJsonPath

      public void setJsonPath(String jsonPath)
      Sets the JSON path filter (optional).

      If set, only the specified path within the JsonState is output. For example, "cluster.nodes" would output only the nodes array.

      Parameters:
      jsonPath - the JSON path filter, or null for entire state
    • generate

      public String generate()
      Description copied from interface: SectionBuilder
      Generates the section content.
      Specified by:
      generate in interface SectionBuilder
      Returns:
      the section content as a string
    • getTitle

      public String getTitle()
      Description copied from interface: SectionBuilder
      Returns the section title.

      If null or empty, the section content is output without a title line.

      Specified by:
      getTitle in interface SectionBuilder
      Returns:
      the section title, or null for no title