Class AbstractIssue

java.lang.Object
ai.timefold.solver.service.definition.api.validation.AbstractIssue
All Implemented Interfaces:
Issue
Direct Known Subclasses:
AbstractLegacyIssue

public abstract non-sealed class AbstractIssue extends Object implements Issue
Base class for all validation issues.

Users should extend this class to define custom issue types for their model validators.

Subclasses are discovered automatically at build time via Quarkus and registered in the ValidationIssueTypeCatalog. Each concrete subclass must have a no-arg constructor so it can be instantiated during the build-time discovery process.

Example:

public class MyIssue extends AbstractIssue {
    public static final IssueCode CODE = new IssueCode("MY_ISSUE");

    public MyIssue() {
        super(CODE, IssueSeverity.ERROR, List.of(new IssueMessage("Something went wrong.")));
    }
}
  • Constructor Details

  • Method Details

    • getSeverity

      public IssueSeverity getSeverity()
      Description copied from interface: Issue
      Returns the severity of this issue, indicating how critical it is.
      Specified by:
      getSeverity in interface Issue
      Returns:
      the IssueSeverity
    • getCode

      public IssueCode getCode()
      Description copied from interface: Issue
      Returns the unique code identifying the type of this issue.
      Specified by:
      getCode in interface Issue
      Returns:
      the IssueCode
    • getMetadata

      public List<IssueMetadata> getMetadata()
      Description copied from interface: Issue
      Returns additional metadata associated with this issue, such as human-readable messages.
      Specified by:
      getMetadata in interface Issue
      Returns:
      an unmodifiable list of IssueMetadata; may be empty