Interface WeightedScoreImpacter<Score_ extends Score<Score_>,Context_ extends ScoreContext<Score_>>
public interface WeightedScoreImpacter<Score_ extends Score<Score_>,Context_ extends ScoreContext<Score_>>
There are several valid ways how an impacter could be called from a constraint stream:
.penalize(..., (int) 1).penalizeLong(..., (int) 1).penalizeLong(..., (long) 1).penalizeBigDecimal(..., (int) 1).penalizeBigDecimal(..., (long) 1).penalizeBigDecimal(..., BigDecimal.ONE)- Plus reward variants of the above.
UnsupportedOperationException
for the method types it doesn't support. The CS API guarantees no types are mixed. For example,
a BigDecimal parameter method won't be called on an instance built with an WeightedScoreImpacter.IntImpactFunction.-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceWeightedScoreImpacter.BigDecimalImpactFunction<Score_ extends Score<Score_>,Context_ extends ScoreContext<Score_>> static interfaceWeightedScoreImpacter.IntImpactFunction<Score_ extends Score<Score_>,Context_ extends ScoreContext<Score_>> static interfaceWeightedScoreImpacter.LongImpactFunction<Score_ extends Score<Score_>,Context_ extends ScoreContext<Score_>> -
Method Summary
Modifier and TypeMethodDescriptionimpactScore(int matchWeight, JustificationsSupplier justificationsSupplier) impactScore(long matchWeight, JustificationsSupplier justificationsSupplier) impactScore(BigDecimal matchWeight, JustificationsSupplier justificationsSupplier) static <Score_ extends Score<Score_>,Context_ extends ScoreContext<Score_>>
WeightedScoreImpacter<Score_,Context_> of(Context_ context, WeightedScoreImpacter.BigDecimalImpactFunction<Score_, Context_> impactFunction) static <Score_ extends Score<Score_>,Context_ extends ScoreContext<Score_>>
WeightedScoreImpacter<Score_,Context_> of(Context_ context, WeightedScoreImpacter.IntImpactFunction<Score_, Context_> impactFunction) static <Score_ extends Score<Score_>,Context_ extends ScoreContext<Score_>>
WeightedScoreImpacter<Score_,Context_> of(Context_ context, WeightedScoreImpacter.LongImpactFunction<Score_, Context_> impactFunction)
-
Method Details
-
of
static <Score_ extends Score<Score_>,Context_ extends ScoreContext<Score_>> WeightedScoreImpacter<Score_,Context_> of(Context_ context, WeightedScoreImpacter.IntImpactFunction<Score_, Context_> impactFunction) -
of
static <Score_ extends Score<Score_>,Context_ extends ScoreContext<Score_>> WeightedScoreImpacter<Score_,Context_> of(Context_ context, WeightedScoreImpacter.LongImpactFunction<Score_, Context_> impactFunction) -
of
static <Score_ extends Score<Score_>,Context_ extends ScoreContext<Score_>> WeightedScoreImpacter<Score_,Context_> of(Context_ context, WeightedScoreImpacter.BigDecimalImpactFunction<Score_, Context_> impactFunction) -
impactScore
- Parameters:
matchWeight- never nulljustificationsSupplier- ignored unless constraint match enableds- Returns:
- never null
-
impactScore
- Parameters:
matchWeight- never nulljustificationsSupplier- ignored unless constraint match enabled- Returns:
- never null
-
impactScore
UndoScoreImpacter impactScore(BigDecimal matchWeight, JustificationsSupplier justificationsSupplier) - Parameters:
matchWeight- never nulljustificationsSupplier- ignored unless constraint match enabled- Returns:
- never null
-
getContext
Context_ getContext()
-