Class JsonStateSection
java.lang.Object
com.scivicslab.actoriac.report.sections.basic.JsonStateSection
- All Implemented Interfaces:
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 Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongenerate()Generates the section content.getTitle()Returns the section title.voidsetActorName(String actorName) Sets the actor name (for display in title).voidsetJsonPath(String jsonPath) Sets the JSON path filter (optional).voidsetYamlContent(String yamlContent) Sets the YAML content to output.
-
Field Details
-
actorName
-
yamlContent
-
jsonPath
-
-
Constructor Details
-
JsonStateSection
public JsonStateSection()
-
-
Method Details
-
setActorName
Sets the actor name (for display in title).- Parameters:
actorName- the actor name
-
setYamlContent
Sets the YAML content to output.- Parameters:
yamlContent- the YAML-formatted JsonState content
-
setJsonPath
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
Description copied from interface:SectionBuilderGenerates the section content.- Specified by:
generatein interfaceSectionBuilder- Returns:
- the section content as a string
-
getTitle
Description copied from interface:SectionBuilderReturns the section title.If null or empty, the section content is output without a title line.
- Specified by:
getTitlein interfaceSectionBuilder- Returns:
- the section title, or null for no title
-