Module agentforge4j.config.loader
Record Class ValidationCheck
java.lang.Object
java.lang.Record
com.agentforge4j.config.loader.validation.ValidationCheck
- Record Components:
code- stable identifier for the check, used in loader logs and draftValidationError.code()valuesdraftExempt-truewhen draft validation deliberately skips this check;falsemeans every entry point runs it. No current check is exempt — the flag exists so a future exemption is an explicit, documented decision rather than a silent omissionaction- the validation action; receives the loaded workflows and agents
public record ValidationCheck(String code, boolean draftExempt, BiConsumer<Map<String,WorkflowDefinition>,Map<String,AgentDefinition>> action)
extends Record
Single ordered registry of the named workflow-validation checks, shared by every validation entry
point so the suite of checks cannot drift between them. Two legitimate, different runner
strategies consume the same
suite(WorkflowValidator): the loader's fail-fast runner (throws
on the first failing check) and the draft validator's collect-all runner (accumulates every failure
into a report) — only the run strategy differs, never the list of checks.-
Constructor Summary
ConstructorsConstructorDescriptionValidationCheck(String code, boolean draftExempt, BiConsumer<Map<String, WorkflowDefinition>, Map<String, AgentDefinition>> action) Creates an instance of aValidationCheckrecord class. -
Method Summary
Modifier and TypeMethodDescriptionaction()Returns the value of theactionrecord component.code()Returns the value of thecoderecord component.booleanReturns the value of thedraftExemptrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.static List<ValidationCheck>suite(WorkflowValidator validator) Builds the ordered suite of workflow validation checks backed byvalidator.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
ValidationCheck
public ValidationCheck(String code, boolean draftExempt, BiConsumer<Map<String, WorkflowDefinition>, Map<String, AgentDefinition>> action) Creates an instance of aValidationCheckrecord class.- Parameters:
code- the value for thecoderecord componentdraftExempt- the value for thedraftExemptrecord componentaction- the value for theactionrecord component
-
-
Method Details
-
suite
Builds the ordered suite of workflow validation checks backed byvalidator.- Parameters:
validator- theWorkflowValidatorinstance whose methods back each check- Returns:
- immutable ordered list of checks
-
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
code
Returns the value of thecoderecord component.- Returns:
- the value of the
coderecord component
-
draftExempt
public boolean draftExempt()Returns the value of thedraftExemptrecord component.- Returns:
- the value of the
draftExemptrecord component
-
action
Returns the value of theactionrecord component.- Returns:
- the value of the
actionrecord component
-