Interface ConstraintVerifier<ConstraintProvider_ extends ConstraintProvider,Solution_>
-
- Type Parameters:
ConstraintProvider_
-Solution_
-
- All Known Implementing Classes:
DefaultConstraintVerifier
public interface ConstraintVerifier<ConstraintProvider_ extends ConstraintProvider,Solution_>
Implementations must be thread-safe, in order to enable parallel test execution.
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description static <ConstraintProvider_ extends ConstraintProvider,Solution_>
ConstraintVerifier<ConstraintProvider_,Solution_>build(ConstraintProvider_ constraintProvider, Class<Solution_> planningSolutionClass, Class<?>... entityClasses)
Entry point to the API.static <ConstraintProvider_ extends ConstraintProvider,Solution_>
ConstraintVerifier<ConstraintProvider_,Solution_>create(SolverConfig solverConfig)
Uses aSolverConfig
to build aConstraintVerifier
.MultiConstraintVerification<Solution_>
verifyThat()
Creates a constraint verifier for all constraints of theConstraintProvider
.SingleConstraintVerification<Solution_>
verifyThat(BiFunction<ConstraintProvider_,ConstraintFactory,Constraint> constraintFunction)
Creates a constraint verifier for a givenConstraint
of theConstraintProvider
.ConstraintVerifier<ConstraintProvider_,Solution_>
withConstraintStreamImplType(ConstraintStreamImplType constraintStreamImplType)
All subsequent calls toverifyThat(BiFunction)
andverifyThat()
use the givenConstraintStreamImplType
.ConstraintVerifier<ConstraintProvider_,Solution_>
withDroolsAlphaNetworkCompilationEnabled(boolean droolsAlphaNetworkCompilationEnabled)
Applies only toConstraintStreamImplType.DROOLS
.
-
-
-
Method Detail
-
build
static <ConstraintProvider_ extends ConstraintProvider,Solution_> ConstraintVerifier<ConstraintProvider_,Solution_> build(ConstraintProvider_ constraintProvider, Class<Solution_> planningSolutionClass, Class<?>... entityClasses)
Entry point to the API.- Type Parameters:
ConstraintProvider_
- type of theConstraintProvider
Solution_
- type of thePlanningSolution
-annotated class- Parameters:
constraintProvider
- never null,PlanningEntity
used by thePlanningSolution
planningSolutionClass
- never null,PlanningSolution
-annotated class associated with the constraintsentityClasses
- never null, at least one,PlanningEntity
types used by thePlanningSolution
- Returns:
- never null
-
create
static <ConstraintProvider_ extends ConstraintProvider,Solution_> ConstraintVerifier<ConstraintProvider_,Solution_> create(SolverConfig solverConfig)
Uses aSolverConfig
to build aConstraintVerifier
. Alternative tobuild(ConstraintProvider, Class, Class[])
.- Type Parameters:
ConstraintProvider_
- type of theConstraintProvider
Solution_
- type of thePlanningSolution
-annotated class- Parameters:
solverConfig
- never null, must have aPlanningSolution
class,PlanningEntity
classes and aConstraintProvider
configured.- Returns:
- never null
-
withConstraintStreamImplType
ConstraintVerifier<ConstraintProvider_,Solution_> withConstraintStreamImplType(ConstraintStreamImplType constraintStreamImplType)
All subsequent calls toverifyThat(BiFunction)
andverifyThat()
use the givenConstraintStreamImplType
.- Parameters:
constraintStreamImplType
- never null- Returns:
- this
-
withDroolsAlphaNetworkCompilationEnabled
ConstraintVerifier<ConstraintProvider_,Solution_> withDroolsAlphaNetworkCompilationEnabled(boolean droolsAlphaNetworkCompilationEnabled)
Applies only toConstraintStreamImplType.DROOLS
. Do not enable when running in a native image.- Parameters:
droolsAlphaNetworkCompilationEnabled
- true to enable the alpha network compiler- Returns:
- this
-
verifyThat
SingleConstraintVerification<Solution_> verifyThat(BiFunction<ConstraintProvider_,ConstraintFactory,Constraint> constraintFunction)
Creates a constraint verifier for a givenConstraint
of theConstraintProvider
.- Parameters:
constraintFunction
- never null- Returns:
- never null
-
verifyThat
MultiConstraintVerification<Solution_> verifyThat()
Creates a constraint verifier for all constraints of theConstraintProvider
.- Returns:
- never null
-
-