Class AbstractIssue
java.lang.Object
ai.timefold.solver.service.definition.api.validation.AbstractIssue
- All Implemented Interfaces:
Issue
- Direct Known Subclasses:
AbstractLegacyIssue
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 Summary
ConstructorsConstructorDescriptionAbstractIssue(IssueCode code, IssueSeverity severity, List<IssueMetadata> metadata) -
Method Summary
Modifier and TypeMethodDescriptiongetCode()Returns the unique code identifying the type of this issue.Returns additional metadata associated with this issue, such as human-readable messages.Returns the severity of this issue, indicating how critical it is.
-
Constructor Details
-
AbstractIssue
-
-
Method Details
-
getSeverity
Description copied from interface:IssueReturns the severity of this issue, indicating how critical it is.- Specified by:
getSeverityin interfaceIssue- Returns:
- the
IssueSeverity
-
getCode
-
getMetadata
Description copied from interface:IssueReturns additional metadata associated with this issue, such as human-readable messages.- Specified by:
getMetadatain interfaceIssue- Returns:
- an unmodifiable list of
IssueMetadata; may be empty
-