Package com.tnsai.events
Record Class AgentHierarchyEvent
java.lang.Object
java.lang.Record
com.tnsai.events.AgentHierarchyEvent
- Record Components:
eventId- unique identifier for this eventtimestamp- when the event occurredagentNodes- a list of maps, each representing an agent in the hierarchy with its ID, name, role, status, and children IDs.
- All Implemented Interfaces:
TnsAIEvent
public record AgentHierarchyEvent(String eventId, Instant timestamp, List<Map<String,Object>> agentNodes)
extends Record
implements TnsAIEvent
Event representing a snapshot of the agent's hierarchy and state,
intended for multi-agent visualization in the frontend.
To create an event from an Agent hierarchy, use
AgentHierarchyMapper.toNodeList(com.tnsai.agents.Agent)
to build the node list first.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theagentNodesrecord component.final booleanIndicates whether some other object is "equal to" this one.eventId()Returns the value of theeventIdrecord component.final inthashCode()Returns a hash code value for this object.static AgentHierarchyEventCreates a new AgentHierarchyEvent from a pre-built list of agent nodes.Returns the value of thetimestamprecord component.final StringtoString()Returns a string representation of this record class.Methods inherited from interface com.tnsai.events.TnsAIEvent
eventType
-
Constructor Details
-
AgentHierarchyEvent
Creates an instance of aAgentHierarchyEventrecord class.- Parameters:
eventId- the value for theeventIdrecord componenttimestamp- the value for thetimestamprecord componentagentNodes- the value for theagentNodesrecord component
-
-
Method Details
-
of
Creates a new AgentHierarchyEvent from a pre-built list of agent nodes.- Parameters:
agentNodes- flat list of agent node maps- Returns:
- a new event instance
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
eventId
Returns the value of theeventIdrecord component.- Specified by:
eventIdin interfaceTnsAIEvent- Returns:
- the value of the
eventIdrecord component
-
timestamp
Returns the value of thetimestamprecord component.- Specified by:
timestampin interfaceTnsAIEvent- Returns:
- the value of the
timestamprecord component
-
agentNodes
Returns the value of theagentNodesrecord component.- Returns:
- the value of the
agentNodesrecord component
-