Interface BiConstraintBuilder<A,B,Score_ extends Score<Score_>>
-
- All Superinterfaces:
ConstraintBuilder
public interface BiConstraintBuilder<A,B,Score_ extends Score<Score_>> extends ConstraintBuilder
Used to build aConstraint
out of aBiConstraintStream
, applying optional configuration. To build the constraint, use one of the terminal operations, such asConstraintBuilder.asConstraint(String)
.Unless
justifyWith(TriFunction)
is called, the default justification mapping will be used. The function takes the input arguments and converts them into aList
.Unless
indictWith(BiFunction)
is called, the default indicted objects' mapping will be used. The function takes the input arguments and converts them into aList
.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description BiConstraintBuilder<A,B,Score_>
indictWith(BiFunction<A,B,Collection<Object>> indictedObjectsMapping)
Sets a custom function to mark any object returned by it as responsible for causing the constraint to match.<ConstraintJustification_ extends ConstraintJustification>
BiConstraintBuilder<A,B,Score_>justifyWith(TriFunction<A,B,Score_,ConstraintJustification_> justificationMapping)
Sets a custom function to apply on a constraint match to justify it.-
Methods inherited from interface org.optaplanner.core.api.score.stream.ConstraintBuilder
asConstraint, asConstraint
-
-
-
-
Method Detail
-
justifyWith
<ConstraintJustification_ extends ConstraintJustification> BiConstraintBuilder<A,B,Score_> justifyWith(TriFunction<A,B,Score_,ConstraintJustification_> justificationMapping)
Sets a custom function to apply on a constraint match to justify it.- Parameters:
justificationMapping
- never null- Returns:
- this
- See Also:
ConstraintMatch
-
indictWith
BiConstraintBuilder<A,B,Score_> indictWith(BiFunction<A,B,Collection<Object>> indictedObjectsMapping)
Sets a custom function to mark any object returned by it as responsible for causing the constraint to match. Each object in the collection returned by this function will become anIndictment
and be available as a key inScoreExplanation.getIndictmentMap()
.- Parameters:
indictedObjectsMapping
- never null- Returns:
- this
-
-