org.optaplanner.core.api.score.stream

## Interface ConstraintProvider

-     public interface ConstraintProvider

  WARNING: The ConstraintStreams/ConstraintProvider API is TECH PREVIEW. It works but it has many API gaps. Therefore, it is not rich enough yet to handle complex constraints.

  Used by constraint stream `Score` calculation.

  An implementation must be stateless.

  See Also:
    `ConstraintStreamScoreDirector`

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `Constraint[]` | `defineConstraints(ConstraintFactory constraintFactory)` This method is called once to create the constraints.

- - ### Method Detail

    - #### defineConstraints

          Constraint[] defineConstraints(ConstraintFactory constraintFactory)

      This method is called once to create the constraints. To create a `Constraint`, start with `ConstraintFactory.from(Class)`.
      Parameters:
        `constraintFactory` - never null
      Returns:
        an array of all `constraints` that could apply. The constraints with a zero `ConstraintWeight` for a particular problem will be automatically disabled when scoring that problem, to improve performance.

Copyright © 2006–2020 JBoss by Red Hat. All rights reserved.