Interface BiConstraintStream<A,B>
-
- Type Parameters:
A- the type of the first fact in the tuple.B- the type of the second fact in the tuple.
- All Superinterfaces:
ConstraintStream
public interface BiConstraintStream<A,B> extends ConstraintStream
AConstraintStreamthat matches two facts.- See Also:
ConstraintStream
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Deprecated Methods Modifier and Type Method Description BiConstraintStream<A,B>distinct()Transforms the stream in such a way that all the tuples going through it are distinct.BiConstraintStream<A,B>filter(BiPredicate<A,B> predicate)Exhaustively test each tuple of facts against theBiPredicateand match ifBiPredicate.test(Object, Object)returns true.<ResultB_> BiConstraintStream<A,ResultB_>flattenLast(Function<B,Iterable<ResultB_>> mapping)Takes each tuple and applies a mapping on the last fact, which turns it intoIterable.<ResultContainer_,Result_>
UniConstraintStream<Result_>groupBy(BiConstraintCollector<A,B,ResultContainer_,Result_> collector)Runs all tuples of the stream through a given @BiConstraintCollectorand converts them into a newUniConstraintStreamwhich only has a single tuple, the result of applyingBiConstraintCollector.<ResultContainerA_,ResultA_,ResultContainerB_,ResultB_>
BiConstraintStream<ResultA_,ResultB_>groupBy(BiConstraintCollector<A,B,ResultContainerA_,ResultA_> collectorA, BiConstraintCollector<A,B,ResultContainerB_,ResultB_> collectorB)Convert theBiConstraintStreamto aBiConstraintStream, containing only a single tuple, the result of applying twoBiConstraintCollectors.<ResultContainerA_,ResultA_,ResultContainerB_,ResultB_,ResultContainerC_,ResultC_>
TriConstraintStream<ResultA_,ResultB_,ResultC_>groupBy(BiConstraintCollector<A,B,ResultContainerA_,ResultA_> collectorA, BiConstraintCollector<A,B,ResultContainerB_,ResultB_> collectorB, BiConstraintCollector<A,B,ResultContainerC_,ResultC_> collectorC)Convert theBiConstraintStreamto aTriConstraintStream, containing only a single tuple, the result of applying threeBiConstraintCollectors.<ResultContainerA_,ResultA_,ResultContainerB_,ResultB_,ResultContainerC_,ResultC_,ResultContainerD_,ResultD_>
QuadConstraintStream<ResultA_,ResultB_,ResultC_,ResultD_>groupBy(BiConstraintCollector<A,B,ResultContainerA_,ResultA_> collectorA, BiConstraintCollector<A,B,ResultContainerB_,ResultB_> collectorB, BiConstraintCollector<A,B,ResultContainerC_,ResultC_> collectorC, BiConstraintCollector<A,B,ResultContainerD_,ResultD_> collectorD)Convert theBiConstraintStreamto aQuadConstraintStream, containing only a single tuple, the result of applying fourBiConstraintCollectors.<GroupKey_>
UniConstraintStream<GroupKey_>groupBy(BiFunction<A,B,GroupKey_> groupKeyMapping)Convert theBiConstraintStreamto aUniConstraintStream, containing the set of tuples resulting from applying the group key mapping function on all tuples of the original stream.<GroupKey_,ResultContainer_,Result_>
BiConstraintStream<GroupKey_,Result_>groupBy(BiFunction<A,B,GroupKey_> groupKeyMapping, BiConstraintCollector<A,B,ResultContainer_,Result_> collector)Convert theBiConstraintStreamto a differentBiConstraintStream, consisting of unique tuples.<GroupKey_,ResultContainerB_,ResultB_,ResultContainerC_,ResultC_>
TriConstraintStream<GroupKey_,ResultB_,ResultC_>groupBy(BiFunction<A,B,GroupKey_> groupKeyMapping, BiConstraintCollector<A,B,ResultContainerB_,ResultB_> collectorB, BiConstraintCollector<A,B,ResultContainerC_,ResultC_> collectorC)Convert theBiConstraintStreamto aTriConstraintStream, consisting of unique tuples with three facts.<GroupKey_,ResultContainerB_,ResultB_,ResultContainerC_,ResultC_,ResultContainerD_,ResultD_>
QuadConstraintStream<GroupKey_,ResultB_,ResultC_,ResultD_>groupBy(BiFunction<A,B,GroupKey_> groupKeyMapping, BiConstraintCollector<A,B,ResultContainerB_,ResultB_> collectorB, BiConstraintCollector<A,B,ResultContainerC_,ResultC_> collectorC, BiConstraintCollector<A,B,ResultContainerD_,ResultD_> collectorD)Convert theBiConstraintStreamto aQuadConstraintStream, consisting of unique tuples with four facts.<GroupKeyA_,GroupKeyB_>
BiConstraintStream<GroupKeyA_,GroupKeyB_>groupBy(BiFunction<A,B,GroupKeyA_> groupKeyAMapping, BiFunction<A,B,GroupKeyB_> groupKeyBMapping)Convert theBiConstraintStreamto a differentBiConstraintStream, consisting of unique tuples.<GroupKeyA_,GroupKeyB_,ResultContainer_,Result_>
TriConstraintStream<GroupKeyA_,GroupKeyB_,Result_>groupBy(BiFunction<A,B,GroupKeyA_> groupKeyAMapping, BiFunction<A,B,GroupKeyB_> groupKeyBMapping, BiConstraintCollector<A,B,ResultContainer_,Result_> collector)Combines the semantics ofgroupBy(BiFunction, BiFunction)andgroupBy(BiConstraintCollector).<GroupKeyA_,GroupKeyB_,ResultContainerC_,ResultC_,ResultContainerD_,ResultD_>
QuadConstraintStream<GroupKeyA_,GroupKeyB_,ResultC_,ResultD_>groupBy(BiFunction<A,B,GroupKeyA_> groupKeyAMapping, BiFunction<A,B,GroupKeyB_> groupKeyBMapping, BiConstraintCollector<A,B,ResultContainerC_,ResultC_> collectorC, BiConstraintCollector<A,B,ResultContainerD_,ResultD_> collectorD)Combines the semantics ofgroupBy(BiFunction, BiFunction)andgroupBy(BiConstraintCollector).<GroupKeyA_,GroupKeyB_,GroupKeyC_>
TriConstraintStream<GroupKeyA_,GroupKeyB_,GroupKeyC_>groupBy(BiFunction<A,B,GroupKeyA_> groupKeyAMapping, BiFunction<A,B,GroupKeyB_> groupKeyBMapping, BiFunction<A,B,GroupKeyC_> groupKeyCMapping)Convert theBiConstraintStreamto aTriConstraintStream, consisting of unique tuples with three facts.<GroupKeyA_,GroupKeyB_,GroupKeyC_,ResultContainerD_,ResultD_>
QuadConstraintStream<GroupKeyA_,GroupKeyB_,GroupKeyC_,ResultD_>groupBy(BiFunction<A,B,GroupKeyA_> groupKeyAMapping, BiFunction<A,B,GroupKeyB_> groupKeyBMapping, BiFunction<A,B,GroupKeyC_> groupKeyCMapping, BiConstraintCollector<A,B,ResultContainerD_,ResultD_> collectorD)Combines the semantics ofgroupBy(BiFunction, BiFunction)andgroupBy(BiConstraintCollector).<GroupKeyA_,GroupKeyB_,GroupKeyC_,GroupKeyD_>
QuadConstraintStream<GroupKeyA_,GroupKeyB_,GroupKeyC_,GroupKeyD_>groupBy(BiFunction<A,B,GroupKeyA_> groupKeyAMapping, BiFunction<A,B,GroupKeyB_> groupKeyBMapping, BiFunction<A,B,GroupKeyC_> groupKeyCMapping, BiFunction<A,B,GroupKeyD_> groupKeyDMapping)Convert theBiConstraintStreamto aQuadConstraintStream, consisting of unique tuples with four facts.default <C> BiConstraintStream<A,B>ifExists(Class<C> otherClass, TriJoiner<A,B,C> joiner)Create a newBiConstraintStreamfor every pair of A and B where C exists for which theTriJoineris true (for the properties it extracts from the facts).<C> BiConstraintStream<A,B>ifExists(Class<C> otherClass, TriJoiner<A,B,C>... joiners)As defined byifExists(Class, TriJoiner).default <C> BiConstraintStream<A,B>ifExists(Class<C> otherClass, TriJoiner<A,B,C> joiner1, TriJoiner<A,B,C> joiner2)As defined byifExists(Class, TriJoiner).default <C> BiConstraintStream<A,B>ifExists(Class<C> otherClass, TriJoiner<A,B,C> joiner1, TriJoiner<A,B,C> joiner2, TriJoiner<A,B,C> joiner3)As defined byifExists(Class, TriJoiner).default <C> BiConstraintStream<A,B>ifExists(Class<C> otherClass, TriJoiner<A,B,C> joiner1, TriJoiner<A,B,C> joiner2, TriJoiner<A,B,C> joiner3, TriJoiner<A,B,C> joiner4)As defined byifExists(Class, TriJoiner).default <C> BiConstraintStream<A,B>ifExistsIncludingNullVars(Class<C> otherClass, TriJoiner<A,B,C> joiner)Create a newBiConstraintStreamfor every pair of A and B where C exists for which theTriJoineris true (for the properties it extracts from the facts).<C> BiConstraintStream<A,B>ifExistsIncludingNullVars(Class<C> otherClass, TriJoiner<A,B,C>... joiners)As defined byifExistsIncludingNullVars(Class, TriJoiner).default <C> BiConstraintStream<A,B>ifExistsIncludingNullVars(Class<C> otherClass, TriJoiner<A,B,C> joiner1, TriJoiner<A,B,C> joiner2)As defined byifExistsIncludingNullVars(Class, TriJoiner).default <C> BiConstraintStream<A,B>ifExistsIncludingNullVars(Class<C> otherClass, TriJoiner<A,B,C> joiner1, TriJoiner<A,B,C> joiner2, TriJoiner<A,B,C> joiner3)As defined byifExistsIncludingNullVars(Class, TriJoiner).default <C> BiConstraintStream<A,B>ifExistsIncludingNullVars(Class<C> otherClass, TriJoiner<A,B,C> joiner1, TriJoiner<A,B,C> joiner2, TriJoiner<A,B,C> joiner3, TriJoiner<A,B,C> joiner4)As defined byifExistsIncludingNullVars(Class, TriJoiner).default <C> BiConstraintStream<A,B>ifNotExists(Class<C> otherClass, TriJoiner<A,B,C> joiner)Create a newBiConstraintStreamfor every pair of A and B where C does not exist for which theTriJoineris true (for the properties it extracts from the facts).<C> BiConstraintStream<A,B>ifNotExists(Class<C> otherClass, TriJoiner<A,B,C>... joiners)As defined byifNotExists(Class, TriJoiner).default <C> BiConstraintStream<A,B>ifNotExists(Class<C> otherClass, TriJoiner<A,B,C> joiner1, TriJoiner<A,B,C> joiner2)As defined byifNotExists(Class, TriJoiner).default <C> BiConstraintStream<A,B>ifNotExists(Class<C> otherClass, TriJoiner<A,B,C> joiner1, TriJoiner<A,B,C> joiner2, TriJoiner<A,B,C> joiner3)As defined byifNotExists(Class, TriJoiner).default <C> BiConstraintStream<A,B>ifNotExists(Class<C> otherClass, TriJoiner<A,B,C> joiner1, TriJoiner<A,B,C> joiner2, TriJoiner<A,B,C> joiner3, TriJoiner<A,B,C> joiner4)As defined byifNotExists(Class, TriJoiner).default <C> BiConstraintStream<A,B>ifNotExistsIncludingNullVars(Class<C> otherClass, TriJoiner<A,B,C> joiner)Create a newBiConstraintStreamfor every pair of A and B where C does not exist for which theTriJoineris true (for the properties it extracts from the facts).<C> BiConstraintStream<A,B>ifNotExistsIncludingNullVars(Class<C> otherClass, TriJoiner<A,B,C>... joiners)As defined byifNotExistsIncludingNullVars(Class, TriJoiner).default <C> BiConstraintStream<A,B>ifNotExistsIncludingNullVars(Class<C> otherClass, TriJoiner<A,B,C> joiner1, TriJoiner<A,B,C> joiner2)As defined byifNotExistsIncludingNullVars(Class, TriJoiner).default <C> BiConstraintStream<A,B>ifNotExistsIncludingNullVars(Class<C> otherClass, TriJoiner<A,B,C> joiner1, TriJoiner<A,B,C> joiner2, TriJoiner<A,B,C> joiner3)As defined byifNotExistsIncludingNullVars(Class, TriJoiner).default <C> BiConstraintStream<A,B>ifNotExistsIncludingNullVars(Class<C> otherClass, TriJoiner<A,B,C> joiner1, TriJoiner<A,B,C> joiner2, TriJoiner<A,B,C> joiner3, TriJoiner<A,B,C> joiner4)As defined byifNotExistsIncludingNullVars(Class, TriJoiner).default Constraintimpact(String constraintName, Score<?> constraintWeight, ToIntBiFunction<A,B> matchWeigher)Deprecated, for removal: This API element is subject to removal in a future version.Preferimpact(Score, ToIntBiFunction).default Constraintimpact(String constraintPackage, String constraintName, Score<?> constraintWeight, ToIntBiFunction<A,B> matchWeigher)Deprecated, for removal: This API element is subject to removal in a future version.Preferimpact(Score, ToIntBiFunction).default <Score_ extends Score<Score_>>
BiConstraintBuilder<A,B,Score_>impact(Score_ constraintWeight)Positively or negatively impacts theScoreby the constraintWeight for each match and returns a builder to apply optional constraint properties.<Score_ extends Score<Score_>>
BiConstraintBuilder<A,B,Score_>impact(Score_ constraintWeight, ToIntBiFunction<A,B> matchWeigher)Positively or negatively impacts theScoreby constraintWeight multiplied by matchWeight for each match and returns a builder to apply optional constraint properties.default ConstraintimpactBigDecimal(String constraintName, Score<?> constraintWeight, BiFunction<A,B,BigDecimal> matchWeigher)Deprecated, for removal: This API element is subject to removal in a future version.default ConstraintimpactBigDecimal(String constraintPackage, String constraintName, Score<?> constraintWeight, BiFunction<A,B,BigDecimal> matchWeigher)Deprecated, for removal: This API element is subject to removal in a future version.<Score_ extends Score<Score_>>
BiConstraintBuilder<A,B,Score_>impactBigDecimal(Score_ constraintWeight, BiFunction<A,B,BigDecimal> matchWeigher)As defined byimpact(Score, ToIntBiFunction), with an impact of typeBigDecimal.default BiConstraintBuilder<A,B,?>impactConfigurable()Positively impacts theScoreby theConstraintWeightfor each match, and returns a builder to apply optional constraint properties.default ConstraintimpactConfigurable(String constraintPackage, String constraintName, ToIntBiFunction<A,B> matchWeigher)Deprecated, for removal: This API element is subject to removal in a future version.default ConstraintimpactConfigurable(String constraintName, ToIntBiFunction<A,B> matchWeigher)Deprecated, for removal: This API element is subject to removal in a future version.BiConstraintBuilder<A,B,?>impactConfigurable(ToIntBiFunction<A,B> matchWeigher)Positively impacts theScoreby theConstraintWeightmultiplied by match weight for each match, and returns a builder to apply optional constraint properties.default ConstraintimpactConfigurableBigDecimal(String constraintPackage, String constraintName, BiFunction<A,B,BigDecimal> matchWeigher)Deprecated, for removal: This API element is subject to removal in a future version.default ConstraintimpactConfigurableBigDecimal(String constraintName, BiFunction<A,B,BigDecimal> matchWeigher)Deprecated, for removal: This API element is subject to removal in a future version.BiConstraintBuilder<A,B,?>impactConfigurableBigDecimal(BiFunction<A,B,BigDecimal> matchWeigher)As defined byimpactConfigurable(ToIntBiFunction), with an impact of type BigDecimal.default ConstraintimpactConfigurableLong(String constraintPackage, String constraintName, ToLongBiFunction<A,B> matchWeigher)Deprecated, for removal: This API element is subject to removal in a future version.default ConstraintimpactConfigurableLong(String constraintName, ToLongBiFunction<A,B> matchWeigher)Deprecated, for removal: This API element is subject to removal in a future version.BiConstraintBuilder<A,B,?>impactConfigurableLong(ToLongBiFunction<A,B> matchWeigher)As defined byimpactConfigurable(ToIntBiFunction), with an impact of type long.default ConstraintimpactLong(String constraintName, Score<?> constraintWeight, ToLongBiFunction<A,B> matchWeigher)Deprecated, for removal: This API element is subject to removal in a future version.default ConstraintimpactLong(String constraintPackage, String constraintName, Score<?> constraintWeight, ToLongBiFunction<A,B> matchWeigher)Deprecated, for removal: This API element is subject to removal in a future version.<Score_ extends Score<Score_>>
BiConstraintBuilder<A,B,Score_>impactLong(Score_ constraintWeight, ToLongBiFunction<A,B> matchWeigher)As defined byimpact(Score, ToIntBiFunction), with an impact of type long.default <C> TriConstraintStream<A,B,C>join(UniConstraintStream<C> otherStream)Create a newTriConstraintStreamfor every combination of [A, B] and C.default <C> TriConstraintStream<A,B,C>join(UniConstraintStream<C> otherStream, TriJoiner<A,B,C> joiner)Create a newTriConstraintStreamfor every combination of [A, B] and C for which theTriJoineris true (for the properties it extracts from both facts).<C> TriConstraintStream<A,B,C>join(UniConstraintStream<C> otherStream, TriJoiner<A,B,C>... joiners)As defined byjoin(Class, TriJoiner).default <C> TriConstraintStream<A,B,C>join(UniConstraintStream<C> otherStream, TriJoiner<A,B,C> joiner1, TriJoiner<A,B,C> joiner2)As defined byjoin(Class, TriJoiner).default <C> TriConstraintStream<A,B,C>join(UniConstraintStream<C> otherStream, TriJoiner<A,B,C> joiner1, TriJoiner<A,B,C> joiner2, TriJoiner<A,B,C> joiner3)As defined byjoin(Class, TriJoiner).default <C> TriConstraintStream<A,B,C>join(UniConstraintStream<C> otherStream, TriJoiner<A,B,C> joiner1, TriJoiner<A,B,C> joiner2, TriJoiner<A,B,C> joiner3, TriJoiner<A,B,C> joiner4)As defined byjoin(Class, TriJoiner).default <C> TriConstraintStream<A,B,C>join(Class<C> otherClass)Create a newTriConstraintStreamfor every combination of [A, B] and C.default <C> TriConstraintStream<A,B,C>join(Class<C> otherClass, TriJoiner<A,B,C> joiner)Create a newTriConstraintStreamfor every combination of [A, B] and C for which theTriJoineris true (for the properties it extracts from both facts).<C> TriConstraintStream<A,B,C>join(Class<C> otherClass, TriJoiner<A,B,C>... joiners)As defined byjoin(Class, TriJoiner).default <C> TriConstraintStream<A,B,C>join(Class<C> otherClass, TriJoiner<A,B,C> joiner1, TriJoiner<A,B,C> joiner2)As defined byjoin(Class, TriJoiner).default <C> TriConstraintStream<A,B,C>join(Class<C> otherClass, TriJoiner<A,B,C> joiner1, TriJoiner<A,B,C> joiner2, TriJoiner<A,B,C> joiner3)As defined byjoin(Class, TriJoiner).default <C> TriConstraintStream<A,B,C>join(Class<C> otherClass, TriJoiner<A,B,C> joiner1, TriJoiner<A,B,C> joiner2, TriJoiner<A,B,C> joiner3, TriJoiner<A,B,C> joiner4)As defined byjoin(Class, TriJoiner).<ResultA_> UniConstraintStream<ResultA_>map(BiFunction<A,B,ResultA_> mapping)As defined byUniConstraintStream.map(Function).default Constraintpenalize(String constraintName, Score<?> constraintWeight, ToIntBiFunction<A,B> matchWeigher)Deprecated, for removal: This API element is subject to removal in a future version.Preferpenalize(Score, ToIntBiFunction).default Constraintpenalize(String constraintPackage, String constraintName, Score<?> constraintWeight, ToIntBiFunction<A,B> matchWeigher)Deprecated, for removal: This API element is subject to removal in a future version.Preferpenalize(Score, ToIntBiFunction).default <Score_ extends Score<Score_>>
BiConstraintBuilder<A,B,Score_>penalize(Score_ constraintWeight)As defined bypenalize(Score, ToIntBiFunction), where the match weight is one (1).<Score_ extends Score<Score_>>
BiConstraintBuilder<A,B,Score_>penalize(Score_ constraintWeight, ToIntBiFunction<A,B> matchWeigher)Applies a negativeScoreimpact, subtracting the constraintWeight multiplied by the match weight, and returns a builder to apply optional constraint properties.default ConstraintpenalizeBigDecimal(String constraintName, Score<?> constraintWeight, BiFunction<A,B,BigDecimal> matchWeigher)Deprecated, for removal: This API element is subject to removal in a future version.default ConstraintpenalizeBigDecimal(String constraintPackage, String constraintName, Score<?> constraintWeight, BiFunction<A,B,BigDecimal> matchWeigher)Deprecated, for removal: This API element is subject to removal in a future version.<Score_ extends Score<Score_>>
BiConstraintBuilder<A,B,Score_>penalizeBigDecimal(Score_ constraintWeight, BiFunction<A,B,BigDecimal> matchWeigher)As defined bypenalize(Score, ToIntBiFunction), with a penalty of typeBigDecimal.default BiConstraintBuilder<A,B,?>penalizeConfigurable()Negatively impacts theScore, subtracting theConstraintWeightfor each match, and returns a builder to apply optional constraint properties.default ConstraintpenalizeConfigurable(String constraintPackage, String constraintName, ToIntBiFunction<A,B> matchWeigher)Deprecated, for removal: This API element is subject to removal in a future version.default ConstraintpenalizeConfigurable(String constraintName, ToIntBiFunction<A,B> matchWeigher)Deprecated, for removal: This API element is subject to removal in a future version.BiConstraintBuilder<A,B,?>penalizeConfigurable(ToIntBiFunction<A,B> matchWeigher)Negatively impacts theScore, subtracting theConstraintWeightmultiplied by match weight for each match, and returns a builder to apply optional constraint properties.default ConstraintpenalizeConfigurableBigDecimal(String constraintPackage, String constraintName, BiFunction<A,B,BigDecimal> matchWeigher)Deprecated, for removal: This API element is subject to removal in a future version.default ConstraintpenalizeConfigurableBigDecimal(String constraintName, BiFunction<A,B,BigDecimal> matchWeigher)Deprecated, for removal: This API element is subject to removal in a future version.BiConstraintBuilder<A,B,?>penalizeConfigurableBigDecimal(BiFunction<A,B,BigDecimal> matchWeigher)As defined bypenalizeConfigurable(ToIntBiFunction), with a penalty of typeBigDecimal.default ConstraintpenalizeConfigurableLong(String constraintPackage, String constraintName, ToLongBiFunction<A,B> matchWeigher)Deprecated, for removal: This API element is subject to removal in a future version.default ConstraintpenalizeConfigurableLong(String constraintName, ToLongBiFunction<A,B> matchWeigher)Deprecated, for removal: This API element is subject to removal in a future version.BiConstraintBuilder<A,B,?>penalizeConfigurableLong(ToLongBiFunction<A,B> matchWeigher)As defined bypenalizeConfigurable(ToIntBiFunction), with a penalty of type long.default ConstraintpenalizeLong(String constraintName, Score<?> constraintWeight, ToLongBiFunction<A,B> matchWeigher)Deprecated, for removal: This API element is subject to removal in a future version.default ConstraintpenalizeLong(String constraintPackage, String constraintName, Score<?> constraintWeight, ToLongBiFunction<A,B> matchWeigher)Deprecated, for removal: This API element is subject to removal in a future version.<Score_ extends Score<Score_>>
BiConstraintBuilder<A,B,Score_>penalizeLong(Score_ constraintWeight, ToLongBiFunction<A,B> matchWeigher)As defined bypenalize(Score, ToIntBiFunction), with a penalty of type long.default Constraintreward(String constraintName, Score<?> constraintWeight, ToIntBiFunction<A,B> matchWeigher)Deprecated, for removal: This API element is subject to removal in a future version.Preferreward(Score, ToIntBiFunction).default Constraintreward(String constraintPackage, String constraintName, Score<?> constraintWeight, ToIntBiFunction<A,B> matchWeigher)Deprecated, for removal: This API element is subject to removal in a future version.Preferreward(Score, ToIntBiFunction).default <Score_ extends Score<Score_>>
BiConstraintBuilder<A,B,Score_>reward(Score_ constraintWeight)As defined byreward(Score, ToIntBiFunction), where the match weight is one (1).<Score_ extends Score<Score_>>
BiConstraintBuilder<A,B,Score_>reward(Score_ constraintWeight, ToIntBiFunction<A,B> matchWeigher)Applies a positiveScoreimpact, adding the constraintWeight multiplied by the match weight, and returns a builder to apply optional constraint properties.default ConstraintrewardBigDecimal(String constraintName, Score<?> constraintWeight, BiFunction<A,B,BigDecimal> matchWeigher)Deprecated, for removal: This API element is subject to removal in a future version.default ConstraintrewardBigDecimal(String constraintPackage, String constraintName, Score<?> constraintWeight, BiFunction<A,B,BigDecimal> matchWeigher)Deprecated, for removal: This API element is subject to removal in a future version.<Score_ extends Score<Score_>>
BiConstraintBuilder<A,B,Score_>rewardBigDecimal(Score_ constraintWeight, BiFunction<A,B,BigDecimal> matchWeigher)As defined byreward(Score, ToIntBiFunction), with a penalty of typeBigDecimal.default BiConstraintBuilder<A,B,?>rewardConfigurable()Positively impacts theScore, adding theConstraintWeightfor each match, and returns a builder to apply optional constraint properties.default ConstraintrewardConfigurable(String constraintPackage, String constraintName, ToIntBiFunction<A,B> matchWeigher)Deprecated.default ConstraintrewardConfigurable(String constraintName, ToIntBiFunction<A,B> matchWeigher)Deprecated, for removal: This API element is subject to removal in a future version.BiConstraintBuilder<A,B,?>rewardConfigurable(ToIntBiFunction<A,B> matchWeigher)Positively impacts theScore, adding theConstraintWeightmultiplied by match weight for each match, and returns a builder to apply optional constraint properties.default ConstraintrewardConfigurableBigDecimal(String constraintPackage, String constraintName, BiFunction<A,B,BigDecimal> matchWeigher)Deprecated, for removal: This API element is subject to removal in a future version.default ConstraintrewardConfigurableBigDecimal(String constraintName, BiFunction<A,B,BigDecimal> matchWeigher)Deprecated, for removal: This API element is subject to removal in a future version.BiConstraintBuilder<A,B,?>rewardConfigurableBigDecimal(BiFunction<A,B,BigDecimal> matchWeigher)As defined byrewardConfigurable(ToIntBiFunction), with a penalty of typeBigDecimal.default ConstraintrewardConfigurableLong(String constraintPackage, String constraintName, ToLongBiFunction<A,B> matchWeigher)Deprecated, for removal: This API element is subject to removal in a future version.default ConstraintrewardConfigurableLong(String constraintName, ToLongBiFunction<A,B> matchWeigher)Deprecated, for removal: This API element is subject to removal in a future version.BiConstraintBuilder<A,B,?>rewardConfigurableLong(ToLongBiFunction<A,B> matchWeigher)As defined byrewardConfigurable(ToIntBiFunction), with a penalty of type long.default ConstraintrewardLong(String constraintName, Score<?> constraintWeight, ToLongBiFunction<A,B> matchWeigher)Deprecated, for removal: This API element is subject to removal in a future version.default ConstraintrewardLong(String constraintPackage, String constraintName, Score<?> constraintWeight, ToLongBiFunction<A,B> matchWeigher)Deprecated, for removal: This API element is subject to removal in a future version.<Score_ extends Score<Score_>>
BiConstraintBuilder<A,B,Score_>rewardLong(Score_ constraintWeight, ToLongBiFunction<A,B> matchWeigher)As defined byreward(Score, ToIntBiFunction), with a penalty of type long.-
Methods inherited from interface ai.timefold.solver.core.api.score.stream.ConstraintStream
getConstraintFactory, impact, impact, penalize, penalize, penalizeConfigurable, penalizeConfigurable, reward, reward, rewardConfigurable, rewardConfigurable
-
-
-
-
Method Detail
-
filter
BiConstraintStream<A,B> filter(BiPredicate<A,B> predicate)
Exhaustively test each tuple of facts against theBiPredicateand match ifBiPredicate.test(Object, Object)returns true.Important: This is slower and less scalable than
UniConstraintStream.join(UniConstraintStream, BiJoiner)with a properBiJoinerpredicate (such asJoiners.equal(Function, Function), because the latter applies hashing and/or indexing, so it doesn't create every combination just to filter it out.- Parameters:
predicate- never null- Returns:
- never null
-
join
default <C> TriConstraintStream<A,B,C> join(UniConstraintStream<C> otherStream)
Create a newTriConstraintStreamfor every combination of [A, B] and C.Important:
TriConstraintStream.filter(TriPredicate)Filtering} this is slower and less scalable than ajoin(UniConstraintStream, TriJoiner), because it doesn't apply hashing and/or indexing on the properties, so it creates and checks every combination of [A, B] and C.- Type Parameters:
C- the type of the third matched fact- Parameters:
otherStream- never null- Returns:
- never null, a stream that matches every combination of [A, B] and C
-
join
default <C> TriConstraintStream<A,B,C> join(UniConstraintStream<C> otherStream, TriJoiner<A,B,C> joiner)
Create a newTriConstraintStreamfor every combination of [A, B] and C for which theTriJoineris true (for the properties it extracts from both facts).Important: This is faster and more scalable than a
joinfollowed by afilter, because it applies hashing and/or indexing on the properties, so it doesn't create nor checks every combination of [A, B] and C.- Type Parameters:
C- the type of the third matched fact- Parameters:
otherStream- never nulljoiner- never null- Returns:
- never null, a stream that matches every combination of [A, B] and C for which the
TriFunctionis true
-
join
default <C> TriConstraintStream<A,B,C> join(UniConstraintStream<C> otherStream, TriJoiner<A,B,C> joiner1, TriJoiner<A,B,C> joiner2)
As defined byjoin(Class, TriJoiner). For performance reasons, indexing joiners must be placed before filtering joiners.- Type Parameters:
C- the type of the third matched fact- Parameters:
otherStream- never nulljoiner1- never nulljoiner2- never null- Returns:
- never null, a stream that matches every combination of [A, B] and C for which all the
joinersare true
-
join
default <C> TriConstraintStream<A,B,C> join(UniConstraintStream<C> otherStream, TriJoiner<A,B,C> joiner1, TriJoiner<A,B,C> joiner2, TriJoiner<A,B,C> joiner3)
As defined byjoin(Class, TriJoiner). For performance reasons, indexing joiners must be placed before filtering joiners.- Type Parameters:
C- the type of the third matched fact- Parameters:
otherStream- never nulljoiner1- never nulljoiner2- never nulljoiner3- never null- Returns:
- never null, a stream that matches every combination of [A, B] and C for which all the
joinersare true
-
join
default <C> TriConstraintStream<A,B,C> join(UniConstraintStream<C> otherStream, TriJoiner<A,B,C> joiner1, TriJoiner<A,B,C> joiner2, TriJoiner<A,B,C> joiner3, TriJoiner<A,B,C> joiner4)
As defined byjoin(Class, TriJoiner). For performance reasons, indexing joiners must be placed before filtering joiners.- Type Parameters:
C- the type of the third matched fact- Parameters:
otherStream- never nulljoiner1- never nulljoiner2- never nulljoiner3- never nulljoiner4- never null- Returns:
- never null, a stream that matches every combination of [A, B] and C for which all the
joinersare true
-
join
<C> TriConstraintStream<A,B,C> join(UniConstraintStream<C> otherStream, TriJoiner<A,B,C>... joiners)
As defined byjoin(Class, TriJoiner). For performance reasons, indexing joiners must be placed before filtering joiners.This method causes Unchecked generics array creation for varargs parameter warnings, but we can't fix it with a
SafeVarargsannotation because it's an interface method. Therefore, there are overloaded methods with up to 4BiJoinerparameters.- Type Parameters:
C- the type of the third matched fact- Parameters:
otherStream- never nulljoiners- never null- Returns:
- never null, a stream that matches every combination of [A, B] and C for which all the
joinersare true
-
join
default <C> TriConstraintStream<A,B,C> join(Class<C> otherClass)
Create a newTriConstraintStreamfor every combination of [A, B] and C.Important:
TriConstraintStream.filter(TriPredicate)Filtering} this is slower and less scalable than ajoin(Class, TriJoiner), because it doesn't apply hashing and/or indexing on the properties, so it creates and checks every combination of [A, B] and C.Note that, if a legacy constraint stream uses
ConstraintFactory.from(Class)as opposed toConstraintFactory.forEach(Class), a different range of C may be selected. (SeeConstraintFactory.from(Class)Javadoc.)This method is syntactic sugar for
join(UniConstraintStream).- Type Parameters:
C- the type of the third matched fact- Parameters:
otherClass- never null- Returns:
- never null, a stream that matches every combination of [A, B] and C
-
join
default <C> TriConstraintStream<A,B,C> join(Class<C> otherClass, TriJoiner<A,B,C> joiner)
Create a newTriConstraintStreamfor every combination of [A, B] and C for which theTriJoineris true (for the properties it extracts from both facts).Important: This is faster and more scalable than a
joinfollowed by afilter, because it applies hashing and/or indexing on the properties, so it doesn't create nor checks every combination of [A, B] and C.Note that, if a legacy constraint stream uses
ConstraintFactory.from(Class)as opposed toConstraintFactory.forEach(Class), a different range of C may be selected. (SeeConstraintFactory.from(Class)Javadoc.)This method is syntactic sugar for
join(UniConstraintStream, TriJoiner).This method has overloaded methods with multiple
TriJoinerparameters.- Type Parameters:
C- the type of the third matched fact- Parameters:
otherClass- never nulljoiner- never null- Returns:
- never null, a stream that matches every combination of [A, B] and C for which the
TriJoineris true
-
join
default <C> TriConstraintStream<A,B,C> join(Class<C> otherClass, TriJoiner<A,B,C> joiner1, TriJoiner<A,B,C> joiner2)
As defined byjoin(Class, TriJoiner). For performance reasons, indexing joiners must be placed before filtering joiners.- Type Parameters:
C- the type of the third matched fact- Parameters:
otherClass- never nulljoiner1- never nulljoiner2- never null- Returns:
- never null, a stream that matches every combination of [A, B] and C for which all the
joinersare true
-
join
default <C> TriConstraintStream<A,B,C> join(Class<C> otherClass, TriJoiner<A,B,C> joiner1, TriJoiner<A,B,C> joiner2, TriJoiner<A,B,C> joiner3)
As defined byjoin(Class, TriJoiner). For performance reasons, indexing joiners must be placed before filtering joiners.- Type Parameters:
C- the type of the third matched fact- Parameters:
otherClass- never nulljoiner1- never nulljoiner2- never nulljoiner3- never null- Returns:
- never null, a stream that matches every combination of [A, B] and C for which all the
joinersare true
-
join
default <C> TriConstraintStream<A,B,C> join(Class<C> otherClass, TriJoiner<A,B,C> joiner1, TriJoiner<A,B,C> joiner2, TriJoiner<A,B,C> joiner3, TriJoiner<A,B,C> joiner4)
As defined byjoin(Class, TriJoiner). For performance reasons, indexing joiners must be placed before filtering joiners.- Type Parameters:
C- the type of the third matched fact- Parameters:
otherClass- never nulljoiner1- never nulljoiner2- never nulljoiner3- never nulljoiner4- never null- Returns:
- never null, a stream that matches every combination of [A, B] and C for which all the
joinersare true
-
join
<C> TriConstraintStream<A,B,C> join(Class<C> otherClass, TriJoiner<A,B,C>... joiners)
As defined byjoin(Class, TriJoiner). For performance reasons, indexing joiners must be placed before filtering joiners.This method causes Unchecked generics array creation for varargs parameter warnings, but we can't fix it with a
SafeVarargsannotation because it's an interface method. Therefore, there are overloaded methods with up to 4BiJoinerparameters.- Type Parameters:
C- the type of the third matched fact- Parameters:
otherClass- never nulljoiners- never null- Returns:
- never null, a stream that matches every combination of [A, B] and C for which all the
joinersare true
-
ifExists
default <C> BiConstraintStream<A,B> ifExists(Class<C> otherClass, TriJoiner<A,B,C> joiner)
Create a newBiConstraintStreamfor every pair of A and B where C exists for which theTriJoineris true (for the properties it extracts from the facts).This method has overloaded methods with multiple
TriJoinerparameters.Note that, if a legacy constraint stream uses
ConstraintFactory.from(Class)as opposed toConstraintFactory.forEach(Class), a different definition of exists applies. (SeeConstraintFactory.from(Class)Javadoc.)- Type Parameters:
C- the type of the third matched fact- Parameters:
otherClass- never nulljoiner- never null- Returns:
- never null, a stream that matches every pair of A and B where C exists for which the
TriJoineris true
-
ifExists
default <C> BiConstraintStream<A,B> ifExists(Class<C> otherClass, TriJoiner<A,B,C> joiner1, TriJoiner<A,B,C> joiner2)
As defined byifExists(Class, TriJoiner). For performance reasons, indexing joiners must be placed before filtering joiners.- Type Parameters:
C- the type of the third matched fact- Parameters:
otherClass- never nulljoiner1- never nulljoiner2- never null- Returns:
- never null, a stream that matches every pair of A and B where C exists for which the
TriJoiners are true
-
ifExists
default <C> BiConstraintStream<A,B> ifExists(Class<C> otherClass, TriJoiner<A,B,C> joiner1, TriJoiner<A,B,C> joiner2, TriJoiner<A,B,C> joiner3)
As defined byifExists(Class, TriJoiner). For performance reasons, indexing joiners must be placed before filtering joiners.- Type Parameters:
C- the type of the third matched fact- Parameters:
otherClass- never nulljoiner1- never nulljoiner2- never nulljoiner3- never null- Returns:
- never null, a stream that matches every pair of A and B where C exists for which the
TriJoiners are true
-
ifExists
default <C> BiConstraintStream<A,B> ifExists(Class<C> otherClass, TriJoiner<A,B,C> joiner1, TriJoiner<A,B,C> joiner2, TriJoiner<A,B,C> joiner3, TriJoiner<A,B,C> joiner4)
As defined byifExists(Class, TriJoiner). For performance reasons, indexing joiners must be placed before filtering joiners.- Type Parameters:
C- the type of the third matched fact- Parameters:
otherClass- never nulljoiner1- never nulljoiner2- never nulljoiner3- never nulljoiner4- never null- Returns:
- never null, a stream that matches every pair of A and B where C exists for which the
TriJoiners are true
-
ifExists
<C> BiConstraintStream<A,B> ifExists(Class<C> otherClass, TriJoiner<A,B,C>... joiners)
As defined byifExists(Class, TriJoiner). For performance reasons, indexing joiners must be placed before filtering joiners.This method causes Unchecked generics array creation for varargs parameter warnings, but we can't fix it with a
SafeVarargsannotation because it's an interface method. Therefore, there are overloaded methods with up to 4TriJoinerparameters.- Type Parameters:
C- the type of the third matched fact- Parameters:
otherClass- never nulljoiners- never null- Returns:
- never null, a stream that matches every pair of A and B where C exists for which the
TriJoiners are true
-
ifExistsIncludingNullVars
default <C> BiConstraintStream<A,B> ifExistsIncludingNullVars(Class<C> otherClass, TriJoiner<A,B,C> joiner)
Create a newBiConstraintStreamfor every pair of A and B where C exists for which theTriJoineris true (for the properties it extracts from the facts). For classes annotated withPlanningEntity, this method also includes instances with null variables.This method has overloaded methods with multiple
TriJoinerparameters.- Type Parameters:
C- the type of the third matched fact- Parameters:
otherClass- never nulljoiner- never null- Returns:
- never null, a stream that matches every pair of A and B where C exists for which the
TriJoineris true
-
ifExistsIncludingNullVars
default <C> BiConstraintStream<A,B> ifExistsIncludingNullVars(Class<C> otherClass, TriJoiner<A,B,C> joiner1, TriJoiner<A,B,C> joiner2)
As defined byifExistsIncludingNullVars(Class, TriJoiner). For performance reasons, indexing joiners must be placed before filtering joiners.- Type Parameters:
C- the type of the third matched fact- Parameters:
otherClass- never nulljoiner1- never nulljoiner2- never null- Returns:
- never null, a stream that matches every pair of A and B where C exists for which the
TriJoiners are true
-
ifExistsIncludingNullVars
default <C> BiConstraintStream<A,B> ifExistsIncludingNullVars(Class<C> otherClass, TriJoiner<A,B,C> joiner1, TriJoiner<A,B,C> joiner2, TriJoiner<A,B,C> joiner3)
As defined byifExistsIncludingNullVars(Class, TriJoiner). For performance reasons, indexing joiners must be placed before filtering joiners.- Type Parameters:
C- the type of the third matched fact- Parameters:
otherClass- never nulljoiner1- never nulljoiner2- never nulljoiner3- never null- Returns:
- never null, a stream that matches every pair of A and B where C exists for which the
TriJoiners are true
-
ifExistsIncludingNullVars
default <C> BiConstraintStream<A,B> ifExistsIncludingNullVars(Class<C> otherClass, TriJoiner<A,B,C> joiner1, TriJoiner<A,B,C> joiner2, TriJoiner<A,B,C> joiner3, TriJoiner<A,B,C> joiner4)
As defined byifExistsIncludingNullVars(Class, TriJoiner). For performance reasons, indexing joiners must be placed before filtering joiners.- Type Parameters:
C- the type of the third matched fact- Parameters:
otherClass- never nulljoiner1- never nulljoiner2- never nulljoiner3- never nulljoiner4- never null- Returns:
- never null, a stream that matches every pair of A and B where C exists for which the
TriJoiners are true
-
ifExistsIncludingNullVars
<C> BiConstraintStream<A,B> ifExistsIncludingNullVars(Class<C> otherClass, TriJoiner<A,B,C>... joiners)
As defined byifExistsIncludingNullVars(Class, TriJoiner). For performance reasons, indexing joiners must be placed before filtering joiners.This method causes Unchecked generics array creation for varargs parameter warnings, but we can't fix it with a
SafeVarargsannotation because it's an interface method. Therefore, there are overloaded methods with up to 4TriJoinerparameters.- Type Parameters:
C- the type of the third matched fact- Parameters:
otherClass- never nulljoiners- never null- Returns:
- never null, a stream that matches every pair of A and B where C exists for which the
TriJoiners are true
-
ifNotExists
default <C> BiConstraintStream<A,B> ifNotExists(Class<C> otherClass, TriJoiner<A,B,C> joiner)
Create a newBiConstraintStreamfor every pair of A and B where C does not exist for which theTriJoineris true (for the properties it extracts from the facts).This method has overloaded methods with multiple
TriJoinerparameters.Note that, if a legacy constraint stream uses
ConstraintFactory.from(Class)as opposed toConstraintFactory.forEach(Class), a different definition of exists applies. (SeeConstraintFactory.from(Class)Javadoc.)- Type Parameters:
C- the type of the third matched fact- Parameters:
otherClass- never nulljoiner- never null- Returns:
- never null, a stream that matches every pair of A and B where C does not exist for which the
TriJoineris true
-
ifNotExists
default <C> BiConstraintStream<A,B> ifNotExists(Class<C> otherClass, TriJoiner<A,B,C> joiner1, TriJoiner<A,B,C> joiner2)
As defined byifNotExists(Class, TriJoiner). For performance reasons, indexing joiners must be placed before filtering joiners.- Type Parameters:
C- the type of the third matched fact- Parameters:
otherClass- never nulljoiner1- never nulljoiner2- never null- Returns:
- never null, a stream that matches every pair of A and B where C does not exist for which the
TriJoiners are true
-
ifNotExists
default <C> BiConstraintStream<A,B> ifNotExists(Class<C> otherClass, TriJoiner<A,B,C> joiner1, TriJoiner<A,B,C> joiner2, TriJoiner<A,B,C> joiner3)
As defined byifNotExists(Class, TriJoiner). For performance reasons, indexing joiners must be placed before filtering joiners.- Type Parameters:
C- the type of the third matched fact- Parameters:
otherClass- never nulljoiner1- never nulljoiner2- never nulljoiner3- never null- Returns:
- never null, a stream that matches every pair of A and B where C does not exist for which the
TriJoiners are true
-
ifNotExists
default <C> BiConstraintStream<A,B> ifNotExists(Class<C> otherClass, TriJoiner<A,B,C> joiner1, TriJoiner<A,B,C> joiner2, TriJoiner<A,B,C> joiner3, TriJoiner<A,B,C> joiner4)
As defined byifNotExists(Class, TriJoiner). For performance reasons, indexing joiners must be placed before filtering joiners.- Type Parameters:
C- the type of the third matched fact- Parameters:
otherClass- never nulljoiner1- never nulljoiner2- never nulljoiner3- never nulljoiner4- never null- Returns:
- never null, a stream that matches every pair of A and B where C does not exist for which the
TriJoiners are true
-
ifNotExists
<C> BiConstraintStream<A,B> ifNotExists(Class<C> otherClass, TriJoiner<A,B,C>... joiners)
As defined byifNotExists(Class, TriJoiner). For performance reasons, indexing joiners must be placed before filtering joiners.This method causes Unchecked generics array creation for varargs parameter warnings, but we can't fix it with a
SafeVarargsannotation because it's an interface method. Therefore, there are overloaded methods with up to 4TriJoinerparameters.- Type Parameters:
C- the type of the third matched fact- Parameters:
otherClass- never nulljoiners- never null- Returns:
- never null, a stream that matches every pair of A and B where C does not exist for which the
TriJoiners are true
-
ifNotExistsIncludingNullVars
default <C> BiConstraintStream<A,B> ifNotExistsIncludingNullVars(Class<C> otherClass, TriJoiner<A,B,C> joiner)
Create a newBiConstraintStreamfor every pair of A and B where C does not exist for which theTriJoineris true (for the properties it extracts from the facts). For classes annotated withPlanningEntity, this method also includes instances with null variables.This method has overloaded methods with multiple
TriJoinerparameters.- Type Parameters:
C- the type of the third matched fact- Parameters:
otherClass- never nulljoiner- never null- Returns:
- never null, a stream that matches every pair of A and B where C does not exist for which the
TriJoineris true
-
ifNotExistsIncludingNullVars
default <C> BiConstraintStream<A,B> ifNotExistsIncludingNullVars(Class<C> otherClass, TriJoiner<A,B,C> joiner1, TriJoiner<A,B,C> joiner2)
As defined byifNotExistsIncludingNullVars(Class, TriJoiner). For performance reasons, indexing joiners must be placed before filtering joiners.- Type Parameters:
C- the type of the third matched fact- Parameters:
otherClass- never nulljoiner1- never nulljoiner2- never null- Returns:
- never null, a stream that matches every pair of A and B where C does not exist for which the
TriJoiners are true
-
ifNotExistsIncludingNullVars
default <C> BiConstraintStream<A,B> ifNotExistsIncludingNullVars(Class<C> otherClass, TriJoiner<A,B,C> joiner1, TriJoiner<A,B,C> joiner2, TriJoiner<A,B,C> joiner3)
As defined byifNotExistsIncludingNullVars(Class, TriJoiner). For performance reasons, indexing joiners must be placed before filtering joiners.- Type Parameters:
C- the type of the third matched fact- Parameters:
otherClass- never nulljoiner1- never nulljoiner2- never nulljoiner3- never null- Returns:
- never null, a stream that matches every pair of A and B where C does not exist for which the
TriJoiners are true
-
ifNotExistsIncludingNullVars
default <C> BiConstraintStream<A,B> ifNotExistsIncludingNullVars(Class<C> otherClass, TriJoiner<A,B,C> joiner1, TriJoiner<A,B,C> joiner2, TriJoiner<A,B,C> joiner3, TriJoiner<A,B,C> joiner4)
As defined byifNotExistsIncludingNullVars(Class, TriJoiner). For performance reasons, indexing joiners must be placed before filtering joiners.- Type Parameters:
C- the type of the third matched fact- Parameters:
otherClass- never nulljoiner1- never nulljoiner2- never nulljoiner3- never nulljoiner4- never null- Returns:
- never null, a stream that matches every pair of A and B where C does not exist for which the
TriJoiners are true
-
ifNotExistsIncludingNullVars
<C> BiConstraintStream<A,B> ifNotExistsIncludingNullVars(Class<C> otherClass, TriJoiner<A,B,C>... joiners)
As defined byifNotExistsIncludingNullVars(Class, TriJoiner). For performance reasons, indexing joiners must be placed before filtering joiners.This method causes Unchecked generics array creation for varargs parameter warnings, but we can't fix it with a
SafeVarargsannotation because it's an interface method. Therefore, there are overloaded methods with up to 4TriJoinerparameters.- Type Parameters:
C- the type of the third matched fact- Parameters:
otherClass- never nulljoiners- never null- Returns:
- never null, a stream that matches every pair of A and B where C does not exist for which the
TriJoiners are true
-
groupBy
<ResultContainer_,Result_> UniConstraintStream<Result_> groupBy(BiConstraintCollector<A,B,ResultContainer_,Result_> collector)
Runs all tuples of the stream through a given @BiConstraintCollectorand converts them into a newUniConstraintStreamwhich only has a single tuple, the result of applyingBiConstraintCollector.- Type Parameters:
ResultContainer_- the mutable accumulation type (often hidden as an implementation detail)Result_- the type of a fact in the destinationUniConstraintStream's tuple- Parameters:
collector- never null, the collector to perform the grouping operation with SeeConstraintCollectorsfor common operations, such ascount(),sum()and others.- Returns:
- never null
-
groupBy
<ResultContainerA_,ResultA_,ResultContainerB_,ResultB_> BiConstraintStream<ResultA_,ResultB_> groupBy(BiConstraintCollector<A,B,ResultContainerA_,ResultA_> collectorA, BiConstraintCollector<A,B,ResultContainerB_,ResultB_> collectorB)
Convert theBiConstraintStreamto aBiConstraintStream, containing only a single tuple, the result of applying twoBiConstraintCollectors.- Type Parameters:
ResultContainerA_- the mutable accumulation type (often hidden as an implementation detail)ResultA_- the type of the first fact in the destinationBiConstraintStream's tupleResultContainerB_- the mutable accumulation type (often hidden as an implementation detail)ResultB_- the type of the second fact in the destinationBiConstraintStream's tuple- Parameters:
collectorA- never null, the collector to perform the first grouping operation with SeeConstraintCollectorsfor common operations, such ascount(),sum()and others.collectorB- never null, the collector to perform the second grouping operation with SeeConstraintCollectorsfor common operations, such ascount(),sum()and others.- Returns:
- never null
-
groupBy
<ResultContainerA_,ResultA_,ResultContainerB_,ResultB_,ResultContainerC_,ResultC_> TriConstraintStream<ResultA_,ResultB_,ResultC_> groupBy(BiConstraintCollector<A,B,ResultContainerA_,ResultA_> collectorA, BiConstraintCollector<A,B,ResultContainerB_,ResultB_> collectorB, BiConstraintCollector<A,B,ResultContainerC_,ResultC_> collectorC)
Convert theBiConstraintStreamto aTriConstraintStream, containing only a single tuple, the result of applying threeBiConstraintCollectors.- Type Parameters:
ResultContainerA_- the mutable accumulation type (often hidden as an implementation detail)ResultA_- the type of the first fact in the destinationTriConstraintStream's tupleResultContainerB_- the mutable accumulation type (often hidden as an implementation detail)ResultB_- the type of the second fact in the destinationTriConstraintStream's tupleResultContainerC_- the mutable accumulation type (often hidden as an implementation detail)ResultC_- the type of the third fact in the destinationTriConstraintStream's tuple- Parameters:
collectorA- never null, the collector to perform the first grouping operation with SeeConstraintCollectorsfor common operations, such ascount(),sum()and others.collectorB- never null, the collector to perform the second grouping operation with SeeConstraintCollectorsfor common operations, such ascount(),sum()and others.collectorC- never null, the collector to perform the third grouping operation with SeeConstraintCollectorsfor common operations, such ascount(),sum()and others.- Returns:
- never null
-
groupBy
<ResultContainerA_,ResultA_,ResultContainerB_,ResultB_,ResultContainerC_,ResultC_,ResultContainerD_,ResultD_> QuadConstraintStream<ResultA_,ResultB_,ResultC_,ResultD_> groupBy(BiConstraintCollector<A,B,ResultContainerA_,ResultA_> collectorA, BiConstraintCollector<A,B,ResultContainerB_,ResultB_> collectorB, BiConstraintCollector<A,B,ResultContainerC_,ResultC_> collectorC, BiConstraintCollector<A,B,ResultContainerD_,ResultD_> collectorD)
Convert theBiConstraintStreamto aQuadConstraintStream, containing only a single tuple, the result of applying fourBiConstraintCollectors.- Type Parameters:
ResultContainerA_- the mutable accumulation type (often hidden as an implementation detail)ResultA_- the type of the first fact in the destinationQuadConstraintStream's tupleResultContainerB_- the mutable accumulation type (often hidden as an implementation detail)ResultB_- the type of the second fact in the destinationQuadConstraintStream's tupleResultContainerC_- the mutable accumulation type (often hidden as an implementation detail)ResultC_- the type of the third fact in the destinationQuadConstraintStream's tupleResultContainerD_- the mutable accumulation type (often hidden as an implementation detail)ResultD_- the type of the fourth fact in the destinationQuadConstraintStream's tuple- Parameters:
collectorA- never null, the collector to perform the first grouping operation with SeeConstraintCollectorsfor common operations, such ascount(),sum()and others.collectorB- never null, the collector to perform the second grouping operation with SeeConstraintCollectorsfor common operations, such ascount(),sum()and others.collectorC- never null, the collector to perform the third grouping operation with SeeConstraintCollectorsfor common operations, such ascount(),sum()and others.collectorD- never null, the collector to perform the fourth grouping operation with SeeConstraintCollectorsfor common operations, such ascount(),sum()and others.- Returns:
- never null
-
groupBy
<GroupKey_> UniConstraintStream<GroupKey_> groupBy(BiFunction<A,B,GroupKey_> groupKeyMapping)
Convert theBiConstraintStreamto aUniConstraintStream, containing the set of tuples resulting from applying the group key mapping function on all tuples of the original stream. Neither tuple of the new streamObjects.equals(Object, Object)any other.- Type Parameters:
GroupKey_- the type of a fact in the destinationUniConstraintStream's tuple- Parameters:
groupKeyMapping- never null, mapping function to convert each element in the stream to a different element- Returns:
- never null
-
groupBy
<GroupKey_,ResultContainer_,Result_> BiConstraintStream<GroupKey_,Result_> groupBy(BiFunction<A,B,GroupKey_> groupKeyMapping, BiConstraintCollector<A,B,ResultContainer_,Result_> collector)
Convert theBiConstraintStreamto a differentBiConstraintStream, consisting of unique tuples.The first fact is the return value of the group key mapping function, applied on the incoming tuple. The second fact is the return value of a given
BiConstraintCollectorapplied on all incoming tuples with the same first fact.- Type Parameters:
GroupKey_- the type of the first fact in the destinationBiConstraintStream's tuple; must honorthe general contract of hashCode.ResultContainer_- the mutable accumulation type (often hidden as an implementation detail)Result_- the type of the second fact in the destinationBiConstraintStream's tuple- Parameters:
groupKeyMapping- never null, function to convert the fact in the original tuple to a different factcollector- never null, the collector to perform the grouping operation with SeeConstraintCollectorsfor common operations, such ascount(),sum()and others.- Returns:
- never null
-
groupBy
<GroupKey_,ResultContainerB_,ResultB_,ResultContainerC_,ResultC_> TriConstraintStream<GroupKey_,ResultB_,ResultC_> groupBy(BiFunction<A,B,GroupKey_> groupKeyMapping, BiConstraintCollector<A,B,ResultContainerB_,ResultB_> collectorB, BiConstraintCollector<A,B,ResultContainerC_,ResultC_> collectorC)
Convert theBiConstraintStreamto aTriConstraintStream, consisting of unique tuples with three facts.The first fact is the return value of the group key mapping function, applied on the incoming tuple. The remaining facts are the return value of the respective
BiConstraintCollectorapplied on all incoming tuples with the same first fact.- Type Parameters:
GroupKey_- the type of the first fact in the destinationTriConstraintStream's tuple; must honorthe general contract of hashCode.ResultContainerB_- the mutable accumulation type (often hidden as an implementation detail)ResultB_- the type of the second fact in the destinationTriConstraintStream's tupleResultContainerC_- the mutable accumulation type (often hidden as an implementation detail)ResultC_- the type of the third fact in the destinationTriConstraintStream's tuple- Parameters:
groupKeyMapping- never null, function to convert the fact in the original tuple to a different factcollectorB- never null, the collector to perform the first grouping operation with SeeConstraintCollectorsfor common operations, such ascount(),sum()and others.collectorC- never null, the collector to perform the second grouping operation with SeeConstraintCollectorsfor common operations, such ascount(),sum()and others.- Returns:
- never null
-
groupBy
<GroupKey_,ResultContainerB_,ResultB_,ResultContainerC_,ResultC_,ResultContainerD_,ResultD_> QuadConstraintStream<GroupKey_,ResultB_,ResultC_,ResultD_> groupBy(BiFunction<A,B,GroupKey_> groupKeyMapping, BiConstraintCollector<A,B,ResultContainerB_,ResultB_> collectorB, BiConstraintCollector<A,B,ResultContainerC_,ResultC_> collectorC, BiConstraintCollector<A,B,ResultContainerD_,ResultD_> collectorD)
Convert theBiConstraintStreamto aQuadConstraintStream, consisting of unique tuples with four facts.The first fact is the return value of the group key mapping function, applied on the incoming tuple. The remaining facts are the return value of the respective
BiConstraintCollectorapplied on all incoming tuples with the same first fact.- Type Parameters:
GroupKey_- the type of the first fact in the destinationQuadConstraintStream's tuple; must honorthe general contract of hashCode.ResultContainerB_- the mutable accumulation type (often hidden as an implementation detail)ResultB_- the type of the second fact in the destinationQuadConstraintStream's tupleResultContainerC_- the mutable accumulation type (often hidden as an implementation detail)ResultC_- the type of the third fact in the destinationQuadConstraintStream's tupleResultContainerD_- the mutable accumulation type (often hidden as an implementation detail)ResultD_- the type of the fourth fact in the destinationQuadConstraintStream's tuple- Parameters:
groupKeyMapping- never null, function to convert the fact in the original tuple to a different factcollectorB- never null, the collector to perform the first grouping operation with SeeConstraintCollectorsfor common operations, such ascount(),sum()and others.collectorC- never null, the collector to perform the second grouping operation with SeeConstraintCollectorsfor common operations, such ascount(),sum()and others.collectorD- never null, the collector to perform the third grouping operation with SeeConstraintCollectorsfor common operations, such ascount(),sum()and others.- Returns:
- never null
-
groupBy
<GroupKeyA_,GroupKeyB_> BiConstraintStream<GroupKeyA_,GroupKeyB_> groupBy(BiFunction<A,B,GroupKeyA_> groupKeyAMapping, BiFunction<A,B,GroupKeyB_> groupKeyBMapping)
Convert theBiConstraintStreamto a differentBiConstraintStream, consisting of unique tuples.The first fact is the return value of the first group key mapping function, applied on the incoming tuple. The second fact is the return value of the second group key mapping function, applied on all incoming tuples with the same first fact.
- Type Parameters:
GroupKeyA_- the type of the first fact in the destinationBiConstraintStream's tuple; must honorthe general contract of hashCode.GroupKeyB_- the type of the second fact in the destinationBiConstraintStream's tuple; must honorthe general contract of hashCode.- Parameters:
groupKeyAMapping- never null, function to convert the facts in the original tuple to a new factgroupKeyBMapping- never null, function to convert the facts in the original tuple to another new fact- Returns:
- never null
-
groupBy
<GroupKeyA_,GroupKeyB_,ResultContainer_,Result_> TriConstraintStream<GroupKeyA_,GroupKeyB_,Result_> groupBy(BiFunction<A,B,GroupKeyA_> groupKeyAMapping, BiFunction<A,B,GroupKeyB_> groupKeyBMapping, BiConstraintCollector<A,B,ResultContainer_,Result_> collector)
Combines the semantics ofgroupBy(BiFunction, BiFunction)andgroupBy(BiConstraintCollector). That is, the first and second facts in the tuple follow thegroupBy(BiFunction, BiFunction)semantics, and the third fact is the result of applyingBiConstraintCollector.finisher()on all the tuples of the originalUniConstraintStreamthat belong to the group.- Type Parameters:
GroupKeyA_- the type of the first fact in the destinationTriConstraintStream's tuple; must honorthe general contract of hashCode.GroupKeyB_- the type of the second fact in the destinationTriConstraintStream's tuple; must honorthe general contract of hashCode.ResultContainer_- the mutable accumulation type (often hidden as an implementation detail)Result_- the type of the third fact in the destinationTriConstraintStream's tuple- Parameters:
groupKeyAMapping- never null, function to convert the original tuple into a first factgroupKeyBMapping- never null, function to convert the original tuple into a second factcollector- never null, the collector to perform the grouping operation with SeeConstraintCollectorsfor common operations, such ascount(),sum()and others.- Returns:
- never null
-
groupBy
<GroupKeyA_,GroupKeyB_,ResultContainerC_,ResultC_,ResultContainerD_,ResultD_> QuadConstraintStream<GroupKeyA_,GroupKeyB_,ResultC_,ResultD_> groupBy(BiFunction<A,B,GroupKeyA_> groupKeyAMapping, BiFunction<A,B,GroupKeyB_> groupKeyBMapping, BiConstraintCollector<A,B,ResultContainerC_,ResultC_> collectorC, BiConstraintCollector<A,B,ResultContainerD_,ResultD_> collectorD)
Combines the semantics ofgroupBy(BiFunction, BiFunction)andgroupBy(BiConstraintCollector). That is, the first and second facts in the tuple follow thegroupBy(BiFunction, BiFunction)semantics. The third fact is the result of applying the firstBiConstraintCollector.finisher()on all the tuples of the originalBiConstraintStreamthat belong to the group. The fourth fact is the result of applying the secondBiConstraintCollector.finisher()on all the tuples of the originalBiConstraintStreamthat belong to the group- Type Parameters:
GroupKeyA_- the type of the first fact in the destinationQuadConstraintStream's tuple; must honorthe general contract of hashCode.GroupKeyB_- the type of the second fact in the destinationQuadConstraintStream's tuple; must honorthe general contract of hashCode.ResultContainerC_- the mutable accumulation type (often hidden as an implementation detail)ResultC_- the type of the third fact in the destinationQuadConstraintStream's tupleResultContainerD_- the mutable accumulation type (often hidden as an implementation detail)ResultD_- the type of the fourth fact in the destinationQuadConstraintStream's tuple- Parameters:
groupKeyAMapping- never null, function to convert the original tuple into a first factgroupKeyBMapping- never null, function to convert the original tuple into a second factcollectorC- never null, the collector to perform the first grouping operation with SeeConstraintCollectorsfor common operations, such ascount(),sum()and others.collectorD- never null, the collector to perform the second grouping operation with SeeConstraintCollectorsfor common operations, such ascount(),sum()and others.- Returns:
- never null
-
groupBy
<GroupKeyA_,GroupKeyB_,GroupKeyC_> TriConstraintStream<GroupKeyA_,GroupKeyB_,GroupKeyC_> groupBy(BiFunction<A,B,GroupKeyA_> groupKeyAMapping, BiFunction<A,B,GroupKeyB_> groupKeyBMapping, BiFunction<A,B,GroupKeyC_> groupKeyCMapping)
Convert theBiConstraintStreamto aTriConstraintStream, consisting of unique tuples with three facts.The first fact is the return value of the first group key mapping function, applied on the incoming tuple. The second fact is the return value of the second group key mapping function, applied on all incoming tuples with the same first fact. The third fact is the return value of the third group key mapping function, applied on all incoming tuples with the same first fact.
- Type Parameters:
GroupKeyA_- the type of the first fact in the destinationTriConstraintStream's tuple; must honorthe general contract of hashCode.GroupKeyB_- the type of the second fact in the destinationTriConstraintStream's tuple; must honorthe general contract of hashCode.GroupKeyC_- the type of the third fact in the destinationTriConstraintStream's tuple; must honorthe general contract of hashCode.- Parameters:
groupKeyAMapping- never null, function to convert the original tuple into a first factgroupKeyBMapping- never null, function to convert the original tuple into a second factgroupKeyCMapping- never null, function to convert the original tuple into a third fact- Returns:
- never null
-
groupBy
<GroupKeyA_,GroupKeyB_,GroupKeyC_,ResultContainerD_,ResultD_> QuadConstraintStream<GroupKeyA_,GroupKeyB_,GroupKeyC_,ResultD_> groupBy(BiFunction<A,B,GroupKeyA_> groupKeyAMapping, BiFunction<A,B,GroupKeyB_> groupKeyBMapping, BiFunction<A,B,GroupKeyC_> groupKeyCMapping, BiConstraintCollector<A,B,ResultContainerD_,ResultD_> collectorD)
Combines the semantics ofgroupBy(BiFunction, BiFunction)andgroupBy(BiConstraintCollector). That is, the first three facts in the tuple follow thegroupBy(BiFunction, BiFunction)semantics. The final fact is the result of applying the firstBiConstraintCollector.finisher()on all the tuples of the originalBiConstraintStreamthat belong to the group.- Type Parameters:
GroupKeyA_- the type of the first fact in the destinationQuadConstraintStream's tuple; must honorthe general contract of hashCode.GroupKeyB_- the type of the second fact in the destinationQuadConstraintStream's tuple; must honorthe general contract of hashCode.GroupKeyC_- the type of the third fact in the destinationQuadConstraintStream's tuple; must honorthe general contract of hashCode.ResultContainerD_- the mutable accumulation type (often hidden as an implementation detail)ResultD_- the type of the fourth fact in the destinationQuadConstraintStream's tuple- Parameters:
groupKeyAMapping- never null, function to convert the original tuple into a first factgroupKeyBMapping- never null, function to convert the original tuple into a second factgroupKeyCMapping- never null, function to convert the original tuple into a third factcollectorD- never null, the collector to perform the grouping operation with SeeConstraintCollectorsfor common operations, such ascount(),sum()and others.- Returns:
- never null
-
groupBy
<GroupKeyA_,GroupKeyB_,GroupKeyC_,GroupKeyD_> QuadConstraintStream<GroupKeyA_,GroupKeyB_,GroupKeyC_,GroupKeyD_> groupBy(BiFunction<A,B,GroupKeyA_> groupKeyAMapping, BiFunction<A,B,GroupKeyB_> groupKeyBMapping, BiFunction<A,B,GroupKeyC_> groupKeyCMapping, BiFunction<A,B,GroupKeyD_> groupKeyDMapping)
Convert theBiConstraintStreamto aQuadConstraintStream, consisting of unique tuples with four facts.The first fact is the return value of the first group key mapping function, applied on the incoming tuple. The second fact is the return value of the second group key mapping function, applied on all incoming tuples with the same first fact. The third fact is the return value of the third group key mapping function, applied on all incoming tuples with the same first fact. The fourth fact is the return value of the fourth group key mapping function, applied on all incoming tuples with the same first fact.
- Type Parameters:
GroupKeyA_- the type of the first fact in the destinationQuadConstraintStream's tuple; must honorthe general contract of hashCode.GroupKeyB_- the type of the second fact in the destinationQuadConstraintStream's tuple; must honorthe general contract of hashCode.GroupKeyC_- the type of the third fact in the destinationQuadConstraintStream's tuple; must honorthe general contract of hashCode.GroupKeyD_- the type of the fourth fact in the destinationQuadConstraintStream's tuple; must honorthe general contract of hashCode.- Parameters:
groupKeyAMapping- never null, function to convert the original tuple into a first factgroupKeyBMapping- never null, function to convert the original tuple into a second factgroupKeyCMapping- never null, function to convert the original tuple into a third factgroupKeyDMapping- never null, function to convert the original tuple into a fourth fact- Returns:
- never null
-
map
<ResultA_> UniConstraintStream<ResultA_> map(BiFunction<A,B,ResultA_> mapping)
As defined byUniConstraintStream.map(Function).- Type Parameters:
ResultA_- the type of the only fact in the resultingUniConstraintStream's tuple- Parameters:
mapping- never null, function to convert the original tuple into the new tuple- Returns:
- never null
-
flattenLast
<ResultB_> BiConstraintStream<A,ResultB_> flattenLast(Function<B,Iterable<ResultB_>> mapping)
Takes each tuple and applies a mapping on the last fact, which turns it intoIterable. Returns a constraint stream consisting of tuples of the first fact and the contents of theIterableone after another. In other words, it will replace the current tuple with new tuples, a cartesian product of A and the individual items from theIterable.This may produce a stream with duplicate tuples. See
distinct()for details.In cases where the last fact is already
Iterable, useFunction.identity()as the argument.Simple example: assuming a constraint stream of
(PersonName, Person)[(Ann, (name = Ann, roles = [USER, ADMIN])), (Beth, (name = Beth, roles = [USER])), (Cathy, (name = Cathy, roles = [ADMIN, AUDITOR]))], callingflattenLast(Person::getRoles)on such stream will produce a stream of[(Ann, USER), (Ann, ADMIN), (Beth, USER), (Cathy, ADMIN), (Cathy, AUDITOR)].- Type Parameters:
ResultB_- the type of the last fact in the resulting tuples. It is recommended that this type be deeply immutable. Not following this recommendation may lead to hard-to-debug hashing issues down the stream, especially if this value is ever used as a group key.- Parameters:
mapping- never null, function to convert the last fact in the original tuple intoIterable- Returns:
- never null
-
distinct
BiConstraintStream<A,B> distinct()
Transforms the stream in such a way that all the tuples going through it are distinct. (No two result tuples areequal.)By default, tuples going through a constraint stream are distinct. However, operations such as
map(BiFunction)may create a stream which breaks that promise. By calling this method on such a stream, duplicate copies of the same tuple are omitted at a performance cost.- Returns:
- never null
-
penalize
default <Score_ extends Score<Score_>> BiConstraintBuilder<A,B,Score_> penalize(Score_ constraintWeight)
As defined bypenalize(Score, ToIntBiFunction), where the match weight is one (1).- Returns:
- never null
-
penalize
<Score_ extends Score<Score_>> BiConstraintBuilder<A,B,Score_> penalize(Score_ constraintWeight, ToIntBiFunction<A,B> matchWeigher)
Applies a negativeScoreimpact, subtracting the constraintWeight multiplied by the match weight, and returns a builder to apply optional constraint properties.For non-int
Scoretypes usepenalizeLong(Score, ToLongBiFunction)orpenalizeBigDecimal(Score, BiFunction)instead.- Parameters:
constraintWeight- never nullmatchWeigher- never null, the result of this function (matchWeight) is multiplied by the constraintWeight- Returns:
- never null
-
penalizeLong
<Score_ extends Score<Score_>> BiConstraintBuilder<A,B,Score_> penalizeLong(Score_ constraintWeight, ToLongBiFunction<A,B> matchWeigher)
As defined bypenalize(Score, ToIntBiFunction), with a penalty of type long.
-
penalizeBigDecimal
<Score_ extends Score<Score_>> BiConstraintBuilder<A,B,Score_> penalizeBigDecimal(Score_ constraintWeight, BiFunction<A,B,BigDecimal> matchWeigher)
As defined bypenalize(Score, ToIntBiFunction), with a penalty of typeBigDecimal.
-
penalizeConfigurable
default BiConstraintBuilder<A,B,?> penalizeConfigurable()
Negatively impacts theScore, subtracting theConstraintWeightfor each match, and returns a builder to apply optional constraint properties.The constraintWeight comes from an
ConstraintWeightannotated member on theConstraintConfiguration, so end users can change the constraint weights dynamically. This constraint may be deactivated if theConstraintWeightis zero. If there is noConstraintConfiguration, usepenalize(Score)instead.- Returns:
- never null
-
penalizeConfigurable
BiConstraintBuilder<A,B,?> penalizeConfigurable(ToIntBiFunction<A,B> matchWeigher)
Negatively impacts theScore, subtracting theConstraintWeightmultiplied by match weight for each match, and returns a builder to apply optional constraint properties.The constraintWeight comes from an
ConstraintWeightannotated member on theConstraintConfiguration, so end users can change the constraint weights dynamically. This constraint may be deactivated if theConstraintWeightis zero. If there is noConstraintConfiguration, usepenalize(Score, ToIntBiFunction)instead.- Parameters:
matchWeigher- never null, the result of this function (matchWeight) is multiplied by the constraintWeight- Returns:
- never null
-
penalizeConfigurableLong
BiConstraintBuilder<A,B,?> penalizeConfigurableLong(ToLongBiFunction<A,B> matchWeigher)
As defined bypenalizeConfigurable(ToIntBiFunction), with a penalty of type long.If there is no
ConstraintConfiguration, usepenalizeLong(Score, ToLongBiFunction)instead.
-
penalizeConfigurableBigDecimal
BiConstraintBuilder<A,B,?> penalizeConfigurableBigDecimal(BiFunction<A,B,BigDecimal> matchWeigher)
As defined bypenalizeConfigurable(ToIntBiFunction), with a penalty of typeBigDecimal.If there is no
ConstraintConfiguration, usepenalizeBigDecimal(Score, BiFunction)instead.
-
reward
default <Score_ extends Score<Score_>> BiConstraintBuilder<A,B,Score_> reward(Score_ constraintWeight)
As defined byreward(Score, ToIntBiFunction), where the match weight is one (1).- Returns:
- never null
-
reward
<Score_ extends Score<Score_>> BiConstraintBuilder<A,B,Score_> reward(Score_ constraintWeight, ToIntBiFunction<A,B> matchWeigher)
Applies a positiveScoreimpact, adding the constraintWeight multiplied by the match weight, and returns a builder to apply optional constraint properties.For non-int
Scoretypes userewardLong(Score, ToLongBiFunction)orrewardBigDecimal(Score, BiFunction)instead.- Parameters:
constraintWeight- never nullmatchWeigher- never null, the result of this function (matchWeight) is multiplied by the constraintWeight- Returns:
- never null
-
rewardLong
<Score_ extends Score<Score_>> BiConstraintBuilder<A,B,Score_> rewardLong(Score_ constraintWeight, ToLongBiFunction<A,B> matchWeigher)
As defined byreward(Score, ToIntBiFunction), with a penalty of type long.
-
rewardBigDecimal
<Score_ extends Score<Score_>> BiConstraintBuilder<A,B,Score_> rewardBigDecimal(Score_ constraintWeight, BiFunction<A,B,BigDecimal> matchWeigher)
As defined byreward(Score, ToIntBiFunction), with a penalty of typeBigDecimal.
-
rewardConfigurable
default BiConstraintBuilder<A,B,?> rewardConfigurable()
Positively impacts theScore, adding theConstraintWeightfor each match, and returns a builder to apply optional constraint properties.The constraintWeight comes from an
ConstraintWeightannotated member on theConstraintConfiguration, so end users can change the constraint weights dynamically. This constraint may be deactivated if theConstraintWeightis zero. If there is noConstraintConfiguration, usereward(Score)instead.- Returns:
- never null
-
rewardConfigurable
BiConstraintBuilder<A,B,?> rewardConfigurable(ToIntBiFunction<A,B> matchWeigher)
Positively impacts theScore, adding theConstraintWeightmultiplied by match weight for each match, and returns a builder to apply optional constraint properties.The constraintWeight comes from an
ConstraintWeightannotated member on theConstraintConfiguration, so end users can change the constraint weights dynamically. This constraint may be deactivated if theConstraintWeightis zero. If there is noConstraintConfiguration, usereward(Score, ToIntBiFunction)instead.- Parameters:
matchWeigher- never null, the result of this function (matchWeight) is multiplied by the constraintWeight- Returns:
- never null
-
rewardConfigurableLong
BiConstraintBuilder<A,B,?> rewardConfigurableLong(ToLongBiFunction<A,B> matchWeigher)
As defined byrewardConfigurable(ToIntBiFunction), with a penalty of type long.If there is no
ConstraintConfiguration, userewardLong(Score, ToLongBiFunction)instead.
-
rewardConfigurableBigDecimal
BiConstraintBuilder<A,B,?> rewardConfigurableBigDecimal(BiFunction<A,B,BigDecimal> matchWeigher)
As defined byrewardConfigurable(ToIntBiFunction), with a penalty of typeBigDecimal.If there is no
ConstraintConfiguration, userewardBigDecimal(Score, BiFunction)instead.
-
impact
default <Score_ extends Score<Score_>> BiConstraintBuilder<A,B,Score_> impact(Score_ constraintWeight)
Positively or negatively impacts theScoreby the constraintWeight for each match and returns a builder to apply optional constraint properties.Use
penalize(...)orreward(...)instead, unless this constraint can both have positive and negative weights.- Parameters:
constraintWeight- never null- Returns:
- never null
-
impact
<Score_ extends Score<Score_>> BiConstraintBuilder<A,B,Score_> impact(Score_ constraintWeight, ToIntBiFunction<A,B> matchWeigher)
Positively or negatively impacts theScoreby constraintWeight multiplied by matchWeight for each match and returns a builder to apply optional constraint properties.Use
penalize(...)orreward(...)instead, unless this constraint can both have positive and negative weights.- Parameters:
constraintWeight- never nullmatchWeigher- never null, the result of this function (matchWeight) is multiplied by the constraintWeight- Returns:
- never null
-
impactLong
<Score_ extends Score<Score_>> BiConstraintBuilder<A,B,Score_> impactLong(Score_ constraintWeight, ToLongBiFunction<A,B> matchWeigher)
As defined byimpact(Score, ToIntBiFunction), with an impact of type long.
-
impactBigDecimal
<Score_ extends Score<Score_>> BiConstraintBuilder<A,B,Score_> impactBigDecimal(Score_ constraintWeight, BiFunction<A,B,BigDecimal> matchWeigher)
As defined byimpact(Score, ToIntBiFunction), with an impact of typeBigDecimal.
-
impactConfigurable
default BiConstraintBuilder<A,B,?> impactConfigurable()
Positively impacts theScoreby theConstraintWeightfor each match, and returns a builder to apply optional constraint properties.The constraintWeight comes from an
ConstraintWeightannotated member on theConstraintConfiguration, so end users can change the constraint weights dynamically. This constraint may be deactivated if theConstraintWeightis zero. If there is noConstraintConfiguration, useimpact(Score)instead.- Returns:
- never null
-
impactConfigurable
BiConstraintBuilder<A,B,?> impactConfigurable(ToIntBiFunction<A,B> matchWeigher)
Positively impacts theScoreby theConstraintWeightmultiplied by match weight for each match, and returns a builder to apply optional constraint properties.The constraintWeight comes from an
ConstraintWeightannotated member on theConstraintConfiguration, so end users can change the constraint weights dynamically. This constraint may be deactivated if theConstraintWeightis zero. If there is noConstraintConfiguration, useimpact(Score, ToIntBiFunction)instead.- Returns:
- never null
-
impactConfigurableLong
BiConstraintBuilder<A,B,?> impactConfigurableLong(ToLongBiFunction<A,B> matchWeigher)
As defined byimpactConfigurable(ToIntBiFunction), with an impact of type long.If there is no
ConstraintConfiguration, useimpactLong(Score, ToLongBiFunction)instead.
-
impactConfigurableBigDecimal
BiConstraintBuilder<A,B,?> impactConfigurableBigDecimal(BiFunction<A,B,BigDecimal> matchWeigher)
As defined byimpactConfigurable(ToIntBiFunction), with an impact of type BigDecimal.If there is no
ConstraintConfiguration, useimpactBigDecimal(Score, BiFunction)instead.
-
penalize
@Deprecated(forRemoval=true) default Constraint penalize(String constraintName, Score<?> constraintWeight, ToIntBiFunction<A,B> matchWeigher)
Deprecated, for removal: This API element is subject to removal in a future version.Preferpenalize(Score, ToIntBiFunction).Negatively impact theScore: subtract the constraintWeight multiplied by the match weight. Otherwise as defined byConstraintStream.penalize(String, Score).For non-int
Scoretypes usepenalizeLong(String, Score, ToLongBiFunction)orpenalizeBigDecimal(String, Score, BiFunction)instead.- Parameters:
constraintName- never null, shows up inConstraintMatchTotalduring score justificationconstraintWeight- never nullmatchWeigher- never null, the result of this function (matchWeight) is multiplied by the constraintWeight- Returns:
- never null
-
penalize
@Deprecated(forRemoval=true) default Constraint penalize(String constraintPackage, String constraintName, Score<?> constraintWeight, ToIntBiFunction<A,B> matchWeigher)
Deprecated, for removal: This API element is subject to removal in a future version.Preferpenalize(Score, ToIntBiFunction).As defined bypenalize(String, Score, ToIntBiFunction).- Parameters:
constraintPackage- never nullconstraintName- never nullconstraintWeight- never nullmatchWeigher- never null- Returns:
- never null
-
penalizeLong
@Deprecated(forRemoval=true) default Constraint penalizeLong(String constraintName, Score<?> constraintWeight, ToLongBiFunction<A,B> matchWeigher)
Deprecated, for removal: This API element is subject to removal in a future version.Negatively impact theScore: subtract the constraintWeight multiplied by the match weight. Otherwise as defined byConstraintStream.penalize(String, Score).- Parameters:
constraintName- never null, shows up inConstraintMatchTotalduring score justificationconstraintWeight- never nullmatchWeigher- never null, the result of this function (matchWeight) is multiplied by the constraintWeight- Returns:
- never null
-
penalizeLong
@Deprecated(forRemoval=true) default Constraint penalizeLong(String constraintPackage, String constraintName, Score<?> constraintWeight, ToLongBiFunction<A,B> matchWeigher)
Deprecated, for removal: This API element is subject to removal in a future version.As defined bypenalizeLong(String, Score, ToLongBiFunction).- Parameters:
constraintPackage- never nullconstraintName- never nullconstraintWeight- never nullmatchWeigher- never null- Returns:
- never null
-
penalizeBigDecimal
@Deprecated(forRemoval=true) default Constraint penalizeBigDecimal(String constraintName, Score<?> constraintWeight, BiFunction<A,B,BigDecimal> matchWeigher)
Deprecated, for removal: This API element is subject to removal in a future version.Negatively impact theScore: subtract the constraintWeight multiplied by the match weight. Otherwise as defined byConstraintStream.penalize(String, Score).- Parameters:
constraintName- never null, shows up inConstraintMatchTotalduring score justificationconstraintWeight- never nullmatchWeigher- never null, the result of this function (matchWeight) is multiplied by the constraintWeight- Returns:
- never null
-
penalizeBigDecimal
@Deprecated(forRemoval=true) default Constraint penalizeBigDecimal(String constraintPackage, String constraintName, Score<?> constraintWeight, BiFunction<A,B,BigDecimal> matchWeigher)
Deprecated, for removal: This API element is subject to removal in a future version.As defined bypenalizeBigDecimal(String, Score, BiFunction).- Parameters:
constraintPackage- never nullconstraintName- never nullconstraintWeight- never nullmatchWeigher- never null- Returns:
- never null
-
penalizeConfigurable
@Deprecated(forRemoval=true) default Constraint penalizeConfigurable(String constraintName, ToIntBiFunction<A,B> matchWeigher)
Deprecated, for removal: This API element is subject to removal in a future version.Negatively impact theScore: subtract theConstraintWeightmultiplied by the match weight. Otherwise as defined byConstraintStream.penalizeConfigurable(String).For non-int
Scoretypes usepenalizeConfigurableLong(String, ToLongBiFunction)orpenalizeConfigurableBigDecimal(String, BiFunction)instead.- Parameters:
constraintName- never null, shows up inConstraintMatchTotalduring score justificationmatchWeigher- never null, the result of this function (matchWeight) is multiplied by the constraintWeight- Returns:
- never null
-
penalizeConfigurable
@Deprecated(forRemoval=true) default Constraint penalizeConfigurable(String constraintPackage, String constraintName, ToIntBiFunction<A,B> matchWeigher)
Deprecated, for removal: This API element is subject to removal in a future version.As defined bypenalizeConfigurable(String, ToIntBiFunction).- Parameters:
constraintPackage- never nullconstraintName- never nullmatchWeigher- never null- Returns:
- never null
-
penalizeConfigurableLong
@Deprecated(forRemoval=true) default Constraint penalizeConfigurableLong(String constraintName, ToLongBiFunction<A,B> matchWeigher)
Deprecated, for removal: This API element is subject to removal in a future version.Negatively impact theScore: subtract theConstraintWeightmultiplied by the match weight. Otherwise as defined byConstraintStream.penalizeConfigurable(String).- Parameters:
constraintName- never null, shows up inConstraintMatchTotalduring score justificationmatchWeigher- never null, the result of this function (matchWeight) is multiplied by the constraintWeight- Returns:
- never null
-
penalizeConfigurableLong
@Deprecated(forRemoval=true) default Constraint penalizeConfigurableLong(String constraintPackage, String constraintName, ToLongBiFunction<A,B> matchWeigher)
Deprecated, for removal: This API element is subject to removal in a future version.As defined bypenalizeConfigurableLong(String, ToLongBiFunction).- Parameters:
constraintPackage- never nullconstraintName- never nullmatchWeigher- never null- Returns:
- never null
-
penalizeConfigurableBigDecimal
@Deprecated(forRemoval=true) default Constraint penalizeConfigurableBigDecimal(String constraintName, BiFunction<A,B,BigDecimal> matchWeigher)
Deprecated, for removal: This API element is subject to removal in a future version.Negatively impact theScore: subtract theConstraintWeightmultiplied by the match weight. Otherwise as defined byConstraintStream.penalizeConfigurable(String).- Parameters:
constraintName- never null, shows up inConstraintMatchTotalduring score justificationmatchWeigher- never null, the result of this function (matchWeight) is multiplied by the constraintWeight- Returns:
- never null
-
penalizeConfigurableBigDecimal
@Deprecated(forRemoval=true) default Constraint penalizeConfigurableBigDecimal(String constraintPackage, String constraintName, BiFunction<A,B,BigDecimal> matchWeigher)
Deprecated, for removal: This API element is subject to removal in a future version.As defined bypenalizeConfigurableBigDecimal(String, BiFunction).- Parameters:
constraintPackage- never nullconstraintName- never nullmatchWeigher- never null- Returns:
- never null
-
reward
@Deprecated(forRemoval=true) default Constraint reward(String constraintName, Score<?> constraintWeight, ToIntBiFunction<A,B> matchWeigher)
Deprecated, for removal: This API element is subject to removal in a future version.Preferreward(Score, ToIntBiFunction).Positively impact theScore: add the constraintWeight multiplied by the match weight. Otherwise as defined byConstraintStream.reward(String, Score).For non-int
Scoretypes userewardLong(String, Score, ToLongBiFunction)orrewardBigDecimal(String, Score, BiFunction)instead.- Parameters:
constraintName- never null, shows up inConstraintMatchTotalduring score justificationconstraintWeight- never nullmatchWeigher- never null, the result of this function (matchWeight) is multiplied by the constraintWeight- Returns:
- never null
-
reward
@Deprecated(forRemoval=true) default Constraint reward(String constraintPackage, String constraintName, Score<?> constraintWeight, ToIntBiFunction<A,B> matchWeigher)
Deprecated, for removal: This API element is subject to removal in a future version.Preferreward(Score, ToIntBiFunction).As defined byreward(String, Score, ToIntBiFunction).- Parameters:
constraintPackage- never nullconstraintName- never nullconstraintWeight- never nullmatchWeigher- never null- Returns:
- never null
-
rewardLong
@Deprecated(forRemoval=true) default Constraint rewardLong(String constraintName, Score<?> constraintWeight, ToLongBiFunction<A,B> matchWeigher)
Deprecated, for removal: This API element is subject to removal in a future version.Positively impact theScore: add the constraintWeight multiplied by the match weight. Otherwise as defined byConstraintStream.reward(String, Score).- Parameters:
constraintName- never null, shows up inConstraintMatchTotalduring score justificationconstraintWeight- never nullmatchWeigher- never null, the result of this function (matchWeight) is multiplied by the constraintWeight- Returns:
- never null
-
rewardLong
@Deprecated(forRemoval=true) default Constraint rewardLong(String constraintPackage, String constraintName, Score<?> constraintWeight, ToLongBiFunction<A,B> matchWeigher)
Deprecated, for removal: This API element is subject to removal in a future version.As defined byrewardLong(String, Score, ToLongBiFunction).- Parameters:
constraintPackage- never nullconstraintName- never nullconstraintWeight- never nullmatchWeigher- never null- Returns:
- never null
-
rewardBigDecimal
@Deprecated(forRemoval=true) default Constraint rewardBigDecimal(String constraintName, Score<?> constraintWeight, BiFunction<A,B,BigDecimal> matchWeigher)
Deprecated, for removal: This API element is subject to removal in a future version.Positively impact theScore: add the constraintWeight multiplied by the match weight. Otherwise as defined byConstraintStream.reward(String, Score).- Parameters:
constraintName- never null, shows up inConstraintMatchTotalduring score justificationconstraintWeight- never nullmatchWeigher- never null, the result of this function (matchWeight) is multiplied by the constraintWeight- Returns:
- never null
-
rewardBigDecimal
@Deprecated(forRemoval=true) default Constraint rewardBigDecimal(String constraintPackage, String constraintName, Score<?> constraintWeight, BiFunction<A,B,BigDecimal> matchWeigher)
Deprecated, for removal: This API element is subject to removal in a future version.As defined byrewardBigDecimal(String, Score, BiFunction).- Parameters:
constraintPackage- never nullconstraintName- never nullconstraintWeight- never nullmatchWeigher- never null- Returns:
- never null
-
rewardConfigurable
@Deprecated(forRemoval=true) default Constraint rewardConfigurable(String constraintName, ToIntBiFunction<A,B> matchWeigher)
Deprecated, for removal: This API element is subject to removal in a future version.Positively impact theScore: add theConstraintWeightmultiplied by the match weight. Otherwise as defined byConstraintStream.rewardConfigurable(String).For non-int
Scoretypes userewardConfigurableLong(String, ToLongBiFunction)orrewardConfigurableBigDecimal(String, BiFunction)instead.- Parameters:
constraintName- never null, shows up inConstraintMatchTotalduring score justificationmatchWeigher- never null, the result of this function (matchWeight) is multiplied by the constraintWeight- Returns:
- never null
-
rewardConfigurable
@Deprecated default Constraint rewardConfigurable(String constraintPackage, String constraintName, ToIntBiFunction<A,B> matchWeigher)
Deprecated.As defined byrewardConfigurable(String, ToIntBiFunction).- Parameters:
constraintPackage- never nullconstraintName- never nullmatchWeigher- never null- Returns:
- never null
-
rewardConfigurableLong
@Deprecated(forRemoval=true) default Constraint rewardConfigurableLong(String constraintName, ToLongBiFunction<A,B> matchWeigher)
Deprecated, for removal: This API element is subject to removal in a future version.Positively impact theScore: add theConstraintWeightmultiplied by the match weight. Otherwise as defined byConstraintStream.rewardConfigurable(String).- Parameters:
constraintName- never null, shows up inConstraintMatchTotalduring score justificationmatchWeigher- never null, the result of this function (matchWeight) is multiplied by the constraintWeight- Returns:
- never null
-
rewardConfigurableLong
@Deprecated(forRemoval=true) default Constraint rewardConfigurableLong(String constraintPackage, String constraintName, ToLongBiFunction<A,B> matchWeigher)
Deprecated, for removal: This API element is subject to removal in a future version.As defined byrewardConfigurableLong(String, ToLongBiFunction).- Parameters:
constraintPackage- never nullconstraintName- never nullmatchWeigher- never null- Returns:
- never null
-
rewardConfigurableBigDecimal
@Deprecated(forRemoval=true) default Constraint rewardConfigurableBigDecimal(String constraintName, BiFunction<A,B,BigDecimal> matchWeigher)
Deprecated, for removal: This API element is subject to removal in a future version.Positively impact theScore: add theConstraintWeightmultiplied by the match weight. Otherwise as defined byConstraintStream.rewardConfigurable(String).- Parameters:
constraintName- never null, shows up inConstraintMatchTotalduring score justificationmatchWeigher- never null, the result of this function (matchWeight) is multiplied by the constraintWeight- Returns:
- never null
-
rewardConfigurableBigDecimal
@Deprecated(forRemoval=true) default Constraint rewardConfigurableBigDecimal(String constraintPackage, String constraintName, BiFunction<A,B,BigDecimal> matchWeigher)
Deprecated, for removal: This API element is subject to removal in a future version.As defined byrewardConfigurableBigDecimal(String, BiFunction).- Parameters:
constraintPackage- never nullconstraintName- never nullmatchWeigher- never null- Returns:
- never null
-
impact
@Deprecated(forRemoval=true) default Constraint impact(String constraintName, Score<?> constraintWeight, ToIntBiFunction<A,B> matchWeigher)
Deprecated, for removal: This API element is subject to removal in a future version.Preferimpact(Score, ToIntBiFunction).Positively or negatively impact theScoreby the constraintWeight multiplied by the match weight. Otherwise as defined byConstraintStream.impact(String, Score).Use
penalize(...)orreward(...)instead, unless this constraint can both have positive and negative weights.For non-int
Scoretypes useimpactLong(String, Score, ToLongBiFunction)orimpactBigDecimal(String, Score, BiFunction)instead.- Parameters:
constraintName- never null, shows up inConstraintMatchTotalduring score justificationconstraintWeight- never nullmatchWeigher- never null, the result of this function (matchWeight) is multiplied by the constraintWeight- Returns:
- never null
-
impact
@Deprecated(forRemoval=true) default Constraint impact(String constraintPackage, String constraintName, Score<?> constraintWeight, ToIntBiFunction<A,B> matchWeigher)
Deprecated, for removal: This API element is subject to removal in a future version.Preferimpact(Score, ToIntBiFunction).As defined byimpact(String, Score, ToIntBiFunction).- Parameters:
constraintPackage- never nullconstraintName- never nullconstraintWeight- never nullmatchWeigher- never null- Returns:
- never null
-
impactLong
@Deprecated(forRemoval=true) default Constraint impactLong(String constraintName, Score<?> constraintWeight, ToLongBiFunction<A,B> matchWeigher)
Deprecated, for removal: This API element is subject to removal in a future version.Positively or negatively impact theScoreby the constraintWeight multiplied by the match weight. Otherwise as defined byConstraintStream.impact(String, Score).Use
penalizeLong(...)orrewardLong(...)instead, unless this constraint can both have positive and negative weights.- Parameters:
constraintName- never null, shows up inConstraintMatchTotalduring score justificationconstraintWeight- never nullmatchWeigher- never null, the result of this function (matchWeight) is multiplied by the constraintWeight- Returns:
- never null
-
impactLong
@Deprecated(forRemoval=true) default Constraint impactLong(String constraintPackage, String constraintName, Score<?> constraintWeight, ToLongBiFunction<A,B> matchWeigher)
Deprecated, for removal: This API element is subject to removal in a future version.As defined byimpactLong(String, Score, ToLongBiFunction).- Parameters:
constraintPackage- never nullconstraintName- never nullconstraintWeight- never nullmatchWeigher- never null- Returns:
- never null
-
impactBigDecimal
@Deprecated(forRemoval=true) default Constraint impactBigDecimal(String constraintName, Score<?> constraintWeight, BiFunction<A,B,BigDecimal> matchWeigher)
Deprecated, for removal: This API element is subject to removal in a future version.Positively or negatively impact theScoreby the constraintWeight multiplied by the match weight. Otherwise as defined byConstraintStream.impact(String, Score).Use
penalizeBigDecimal(...)orrewardBigDecimal(...)instead, unless this constraint can both have positive and negative weights.- Parameters:
constraintName- never null, shows up inConstraintMatchTotalduring score justificationconstraintWeight- never nullmatchWeigher- never null, the result of this function (matchWeight) is multiplied by the constraintWeight- Returns:
- never null
-
impactBigDecimal
@Deprecated(forRemoval=true) default Constraint impactBigDecimal(String constraintPackage, String constraintName, Score<?> constraintWeight, BiFunction<A,B,BigDecimal> matchWeigher)
Deprecated, for removal: This API element is subject to removal in a future version.As defined byimpactBigDecimal(String, Score, BiFunction).- Parameters:
constraintPackage- never nullconstraintName- never nullconstraintWeight- never nullmatchWeigher- never null- Returns:
- never null
-
impactConfigurable
@Deprecated(forRemoval=true) default Constraint impactConfigurable(String constraintName, ToIntBiFunction<A,B> matchWeigher)
Deprecated, for removal: This API element is subject to removal in a future version.Positively or negatively impact theScoreby theConstraintWeightmultiplied by the match weight.Use
penalizeConfigurable(...)orrewardConfigurable(...)instead, unless this constraint can both have positive and negative weights.The constraintWeight comes from an
ConstraintWeightannotated member on theConstraintConfiguration, so end users can change the constraint weights dynamically. This constraint may be deactivated if theConstraintWeightis zero. If there is noConstraintConfiguration, useConstraintStream.impact(String, Score)instead.The
Constraint.getConstraintPackage()defaults toConstraintConfiguration.constraintPackage().- Parameters:
constraintName- never null, shows up inConstraintMatchTotalduring score justificationmatchWeigher- never null, the result of this function (matchWeight) is multiplied by the constraintWeight- Returns:
- never null
-
impactConfigurable
@Deprecated(forRemoval=true) default Constraint impactConfigurable(String constraintPackage, String constraintName, ToIntBiFunction<A,B> matchWeigher)
Deprecated, for removal: This API element is subject to removal in a future version.As defined byimpactConfigurable(String, ToIntBiFunction).- Parameters:
constraintPackage- never nullconstraintName- never nullmatchWeigher- never null- Returns:
- never null
-
impactConfigurableLong
@Deprecated(forRemoval=true) default Constraint impactConfigurableLong(String constraintName, ToLongBiFunction<A,B> matchWeigher)
Deprecated, for removal: This API element is subject to removal in a future version.Positively or negatively impact theScoreby theConstraintWeightmultiplied by the match weight.Use
penalizeConfigurableLong(...)orrewardConfigurableLong(...)instead, unless this constraint can both have positive and negative weights.The constraintWeight comes from an
ConstraintWeightannotated member on theConstraintConfiguration, so end users can change the constraint weights dynamically. This constraint may be deactivated if theConstraintWeightis zero. If there is noConstraintConfiguration, useConstraintStream.impact(String, Score)instead.The
Constraint.getConstraintPackage()defaults toConstraintConfiguration.constraintPackage().- Parameters:
constraintName- never null, shows up inConstraintMatchTotalduring score justificationmatchWeigher- never null, the result of this function (matchWeight) is multiplied by the constraintWeight- Returns:
- never null
-
impactConfigurableLong
@Deprecated(forRemoval=true) default Constraint impactConfigurableLong(String constraintPackage, String constraintName, ToLongBiFunction<A,B> matchWeigher)
Deprecated, for removal: This API element is subject to removal in a future version.As defined byimpactConfigurableLong(String, ToLongBiFunction).- Parameters:
constraintPackage- never nullconstraintName- never nullmatchWeigher- never null- Returns:
- never null
-
impactConfigurableBigDecimal
@Deprecated(forRemoval=true) default Constraint impactConfigurableBigDecimal(String constraintName, BiFunction<A,B,BigDecimal> matchWeigher)
Deprecated, for removal: This API element is subject to removal in a future version.Positively or negatively impact theScoreby theConstraintWeightmultiplied by the match weight.Use
penalizeConfigurableBigDecimal(...)orrewardConfigurableBigDecimal(...)instead, unless this constraint can both have positive and negative weights.The constraintWeight comes from an
ConstraintWeightannotated member on theConstraintConfiguration, so end users can change the constraint weights dynamically. This constraint may be deactivated if theConstraintWeightis zero. If there is noConstraintConfiguration, useConstraintStream.impact(String, Score)instead.The
Constraint.getConstraintPackage()defaults toConstraintConfiguration.constraintPackage().- Parameters:
constraintName- never null, shows up inConstraintMatchTotalduring score justificationmatchWeigher- never null, the result of this function (matchWeight) is multiplied by the constraintWeight- Returns:
- never null
-
impactConfigurableBigDecimal
@Deprecated(forRemoval=true) default Constraint impactConfigurableBigDecimal(String constraintPackage, String constraintName, BiFunction<A,B,BigDecimal> matchWeigher)
Deprecated, for removal: This API element is subject to removal in a future version.As defined byimpactConfigurableBigDecimal(String, BiFunction).- Parameters:
constraintPackage- never nullconstraintName- never nullmatchWeigher- never null- Returns:
- never null
-
-