Interface ConstraintProvider
public interface ConstraintProvider
Used by Constraint Streams'
Score
calculation.
An implementation must be stateless in order to facilitate building a single set of constraints
independent of potentially changing constraint weights.-
Method Summary
Modifier and TypeMethodDescriptiondefineConstraints
(ConstraintFactory constraintFactory) This method is called once to create the constraints.
-
Method Details
-
defineConstraints
This method is called once to create the constraints. To create aConstraint
, start withConstraintFactory.forEach(Class)
.- Parameters:
constraintFactory
- never null- Returns:
- an array of all
constraints
that could apply. The constraints with a zeroConstraintWeight
for a particular problem will be automatically disabled when scoring that problem, to improve performance.
-