Package com.tnsai.roles.export
Record Class ExportedRole
java.lang.Object
java.lang.Record
com.tnsai.roles.export.ExportedRole
- Record Components:
identity- role identity (name, goal, domain)autoResponsibilities- responsibilities auto-extracted from@ActionSpecmethodsactions- list of action metadatastates- list of state extracted from@Statefieldsintentions- list of intentions extracted from@ActionSpecmethodsllmSpec- LLM configuration if presentannotations- additional annotation dataclassName- fully qualified class nameversion- role version
public record ExportedRole(RoleIdentity identity, List<RoleSpecExtractor.ResponsibilityInfo> autoResponsibilities, List<ActionMetadata> actions, List<RoleSpecExtractor.StateInfo> states, List<String> intentions, RoleSpecExtractor.LLMExportSpec llmSpec, Map<String,Object> annotations, String className, String version)
extends Record
Immutable data class representing exported role metadata.
As of 0.9.0, the role-level Responsibility bag is gone.
Per-action constraints (mustNever / mustAlways) are carried by
RoleSpecExtractor.ResponsibilityInfo entries returned via
autoResponsibilities().
- Author:
- TnsAI Team
-
Constructor Summary
ConstructorsConstructorDescriptionExportedRole(RoleIdentity identity, List<RoleSpecExtractor.ResponsibilityInfo> autoResponsibilities, List<ActionMetadata> actions, List<RoleSpecExtractor.StateInfo> states, List<String> intentions, RoleSpecExtractor.LLMExportSpec llmSpec, Map<String, Object> annotations, String className, String version) Creates an instance of aExportedRolerecord class. -
Method Summary
Modifier and TypeMethodDescriptionactions()Returns the value of theactionsrecord component.Returns the value of theannotationsrecord component.Returns the value of theautoResponsibilitiesrecord component.Returns the value of theclassNamerecord component.final booleanIndicates whether some other object is "equal to" this one.static ExportedRolestatic ExportedRolegetGoal()getName()booleanbooleanChecks if this role has any auto-extracted responsibilities from@ActionSpecmethods (descriptions, invariants, mustNever/mustAlways).final inthashCode()Returns a hash code value for this object.booleanbooleanbooleanhasState()identity()Returns the value of theidentityrecord component.Returns the value of theintentionsrecord component.llmSpec()Returns the value of thellmSpecrecord component.states()Returns the value of thestatesrecord component.final StringtoString()Returns a string representation of this record class.version()Returns the value of theversionrecord component.
-
Constructor Details
-
ExportedRole
public ExportedRole(RoleIdentity identity, List<RoleSpecExtractor.ResponsibilityInfo> autoResponsibilities, List<ActionMetadata> actions, List<RoleSpecExtractor.StateInfo> states, List<String> intentions, RoleSpecExtractor.LLMExportSpec llmSpec, Map<String, Object> annotations, String className, String version) Creates an instance of aExportedRolerecord class.- Parameters:
identity- the value for theidentityrecord componentautoResponsibilities- the value for theautoResponsibilitiesrecord componentactions- the value for theactionsrecord componentstates- the value for thestatesrecord componentintentions- the value for theintentionsrecord componentllmSpec- the value for thellmSpecrecord componentannotations- the value for theannotationsrecord componentclassName- the value for theclassNamerecord componentversion- the value for theversionrecord component
-
-
Method Details
-
from
-
fromClass
-
hasLLMSpec
public boolean hasLLMSpec() -
hasActions
public boolean hasActions() -
hasState
public boolean hasState() -
hasIntentions
public boolean hasIntentions() -
hasAutoResponsibilities
public boolean hasAutoResponsibilities()Checks if this role has any auto-extracted responsibilities from@ActionSpecmethods (descriptions, invariants, mustNever/mustAlways). -
getName
-
getGoal
-
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). -
identity
Returns the value of theidentityrecord component.- Returns:
- the value of the
identityrecord component
-
autoResponsibilities
Returns the value of theautoResponsibilitiesrecord component.- Returns:
- the value of the
autoResponsibilitiesrecord component
-
actions
Returns the value of theactionsrecord component.- Returns:
- the value of the
actionsrecord component
-
states
Returns the value of thestatesrecord component.- Returns:
- the value of the
statesrecord component
-
intentions
Returns the value of theintentionsrecord component.- Returns:
- the value of the
intentionsrecord component
-
llmSpec
Returns the value of thellmSpecrecord component.- Returns:
- the value of the
llmSpecrecord component
-
annotations
Returns the value of theannotationsrecord component.- Returns:
- the value of the
annotationsrecord component
-
className
Returns the value of theclassNamerecord component.- Returns:
- the value of the
classNamerecord component
-
version
Returns the value of theversionrecord component.- Returns:
- the value of the
versionrecord component
-