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 draft ValidationError.code() values
draftExempt - true when draft validation deliberately skips this check; false means 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 omission
action - 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 Details

  • Method Details

    • suite

      public static List<ValidationCheck> suite(WorkflowValidator validator)
      Builds the ordered suite of workflow validation checks backed by validator.
      Parameters:
      validator - the WorkflowValidator instance whose methods back each check
      Returns:
      immutable ordered list of checks
    • toString

      public final String 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object); primitive components are compared with '=='.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • code

      public String code()
      Returns the value of the code record component.
      Returns:
      the value of the code record component
    • draftExempt

      public boolean draftExempt()
      Returns the value of the draftExempt record component.
      Returns:
      the value of the draftExempt record component
    • action

      Returns the value of the action record component.
      Returns:
      the value of the action record component