Interface UniConstraintStream<A>
-
- Type Parameters:
A- the type of the first and only fact in the tuple.
- All Superinterfaces:
ConstraintStream
public interface UniConstraintStream<A> extends ConstraintStream
AConstraintStreamthat matches one fact.- See Also:
ConstraintStream
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Deprecated Methods Modifier and Type Method Description UniConstraintStream<A>distinct()Transforms the stream in such a way that all the tuples going through it are distinct.UniConstraintStream<A>filter(Predicate<A> predicate)Exhaustively test each fact against thePredicateand match ifPredicate.test(Object)returns true.<ResultA_> UniConstraintStream<ResultA_>flattenLast(Function<A,Iterable<ResultA_>> mapping)Takes each tuple and applies a mapping on it, which turns the tuple into aIterable.<ResultContainer_,Result_>
UniConstraintStream<Result_>groupBy(UniConstraintCollector<A,ResultContainer_,Result_> collector)Convert theUniConstraintStreamto a differentUniConstraintStream, containing only a single tuple, the result of applyingUniConstraintCollector.<ResultContainerA_,ResultA_,ResultContainerB_,ResultB_>
BiConstraintStream<ResultA_,ResultB_>groupBy(UniConstraintCollector<A,ResultContainerA_,ResultA_> collectorA, UniConstraintCollector<A,ResultContainerB_,ResultB_> collectorB)Convert theUniConstraintStreamto aBiConstraintStream, containing only a single tuple, the result of applying twoUniConstraintCollectors.<ResultContainerA_,ResultA_,ResultContainerB_,ResultB_,ResultContainerC_,ResultC_>
TriConstraintStream<ResultA_,ResultB_,ResultC_>groupBy(UniConstraintCollector<A,ResultContainerA_,ResultA_> collectorA, UniConstraintCollector<A,ResultContainerB_,ResultB_> collectorB, UniConstraintCollector<A,ResultContainerC_,ResultC_> collectorC)Convert theUniConstraintStreamto aTriConstraintStream, containing only a single tuple, the result of applying threeUniConstraintCollectors.<ResultContainerA_,ResultA_,ResultContainerB_,ResultB_,ResultContainerC_,ResultC_,ResultContainerD_,ResultD_>
QuadConstraintStream<ResultA_,ResultB_,ResultC_,ResultD_>groupBy(UniConstraintCollector<A,ResultContainerA_,ResultA_> collectorA, UniConstraintCollector<A,ResultContainerB_,ResultB_> collectorB, UniConstraintCollector<A,ResultContainerC_,ResultC_> collectorC, UniConstraintCollector<A,ResultContainerD_,ResultD_> collectorD)Convert theUniConstraintStreamto aQuadConstraintStream, containing only a single tuple, the result of applying fourUniConstraintCollectors.<GroupKey_>
UniConstraintStream<GroupKey_>groupBy(Function<A,GroupKey_> groupKeyMapping)Convert theUniConstraintStreamto a differentUniConstraintStream, 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(Function<A,GroupKey_> groupKeyMapping, UniConstraintCollector<A,ResultContainer_,Result_> collector)Convert theUniConstraintStreamto aBiConstraintStream, consisting of unique tuples with two facts.<GroupKey_,ResultContainerB_,ResultB_,ResultContainerC_,ResultC_>
TriConstraintStream<GroupKey_,ResultB_,ResultC_>groupBy(Function<A,GroupKey_> groupKeyMapping, UniConstraintCollector<A,ResultContainerB_,ResultB_> collectorB, UniConstraintCollector<A,ResultContainerC_,ResultC_> collectorC)Convert theUniConstraintStreamto aTriConstraintStream, consisting of unique tuples with three facts.<GroupKey_,ResultContainerB_,ResultB_,ResultContainerC_,ResultC_,ResultContainerD_,ResultD_>
QuadConstraintStream<GroupKey_,ResultB_,ResultC_,ResultD_>groupBy(Function<A,GroupKey_> groupKeyMapping, UniConstraintCollector<A,ResultContainerB_,ResultB_> collectorB, UniConstraintCollector<A,ResultContainerC_,ResultC_> collectorC, UniConstraintCollector<A,ResultContainerD_,ResultD_> collectorD)Convert theUniConstraintStreamto aQuadConstraintStream, consisting of unique tuples with four facts.<GroupKeyA_,GroupKeyB_>
BiConstraintStream<GroupKeyA_,GroupKeyB_>groupBy(Function<A,GroupKeyA_> groupKeyAMapping, Function<A,GroupKeyB_> groupKeyBMapping)Convert theUniConstraintStreamto aBiConstraintStream, consisting of unique tuples with two facts.<GroupKeyA_,GroupKeyB_,ResultContainer_,Result_>
TriConstraintStream<GroupKeyA_,GroupKeyB_,Result_>groupBy(Function<A,GroupKeyA_> groupKeyAMapping, Function<A,GroupKeyB_> groupKeyBMapping, UniConstraintCollector<A,ResultContainer_,Result_> collector)Combines the semantics ofgroupBy(Function, Function)andgroupBy(UniConstraintCollector).<GroupKeyA_,GroupKeyB_,ResultContainerC_,ResultC_,ResultContainerD_,ResultD_>
QuadConstraintStream<GroupKeyA_,GroupKeyB_,ResultC_,ResultD_>groupBy(Function<A,GroupKeyA_> groupKeyAMapping, Function<A,GroupKeyB_> groupKeyBMapping, UniConstraintCollector<A,ResultContainerC_,ResultC_> collectorC, UniConstraintCollector<A,ResultContainerD_,ResultD_> collectorD)Combines the semantics ofgroupBy(Function, Function)andgroupBy(UniConstraintCollector).<GroupKeyA_,GroupKeyB_,GroupKeyC_>
TriConstraintStream<GroupKeyA_,GroupKeyB_,GroupKeyC_>groupBy(Function<A,GroupKeyA_> groupKeyAMapping, Function<A,GroupKeyB_> groupKeyBMapping, Function<A,GroupKeyC_> groupKeyCMapping)Convert theUniConstraintStreamto aTriConstraintStream, consisting of unique tuples with three facts.<GroupKeyA_,GroupKeyB_,GroupKeyC_,ResultContainerD_,ResultD_>
QuadConstraintStream<GroupKeyA_,GroupKeyB_,GroupKeyC_,ResultD_>groupBy(Function<A,GroupKeyA_> groupKeyAMapping, Function<A,GroupKeyB_> groupKeyBMapping, Function<A,GroupKeyC_> groupKeyCMapping, UniConstraintCollector<A,ResultContainerD_,ResultD_> collectorD)Combines the semantics ofgroupBy(Function, Function)andgroupBy(UniConstraintCollector).<GroupKeyA_,GroupKeyB_,GroupKeyC_,GroupKeyD_>
QuadConstraintStream<GroupKeyA_,GroupKeyB_,GroupKeyC_,GroupKeyD_>groupBy(Function<A,GroupKeyA_> groupKeyAMapping, Function<A,GroupKeyB_> groupKeyBMapping, Function<A,GroupKeyC_> groupKeyCMapping, Function<A,GroupKeyD_> groupKeyDMapping)Convert theUniConstraintStreamto aQuadConstraintStream, consisting of unique tuples with four facts.default <B> UniConstraintStream<A>ifExists(Class<B> otherClass, BiJoiner<A,B> joiner)Create a newUniConstraintStreamfor every A where B exists for which theBiJoineris true (for the properties it extracts from both facts).<B> UniConstraintStream<A>ifExists(Class<B> otherClass, BiJoiner<A,B>... joiners)As defined byifExists(Class, BiJoiner).default <B> UniConstraintStream<A>ifExists(Class<B> otherClass, BiJoiner<A,B> joiner1, BiJoiner<A,B> joiner2)As defined byifExists(Class, BiJoiner).default <B> UniConstraintStream<A>ifExists(Class<B> otherClass, BiJoiner<A,B> joiner1, BiJoiner<A,B> joiner2, BiJoiner<A,B> joiner3)As defined byifExists(Class, BiJoiner).default <B> UniConstraintStream<A>ifExists(Class<B> otherClass, BiJoiner<A,B> joiner1, BiJoiner<A,B> joiner2, BiJoiner<A,B> joiner3, BiJoiner<A,B> joiner4)As defined byifExists(Class, BiJoiner).default <B> UniConstraintStream<A>ifExistsIncludingNullVars(Class<B> otherClass, BiJoiner<A,B> joiner)Create a newUniConstraintStreamfor every A where B exists for which theBiJoineris true (for the properties it extracts from both facts).<B> UniConstraintStream<A>ifExistsIncludingNullVars(Class<B> otherClass, BiJoiner<A,B>... joiners)As defined byifExistsIncludingNullVars(Class, BiJoiner).default <B> UniConstraintStream<A>ifExistsIncludingNullVars(Class<B> otherClass, BiJoiner<A,B> joiner1, BiJoiner<A,B> joiner2)As defined byifExistsIncludingNullVars(Class, BiJoiner).default <B> UniConstraintStream<A>ifExistsIncludingNullVars(Class<B> otherClass, BiJoiner<A,B> joiner1, BiJoiner<A,B> joiner2, BiJoiner<A,B> joiner3)As defined byifExistsIncludingNullVars(Class, BiJoiner).default <B> UniConstraintStream<A>ifExistsIncludingNullVars(Class<B> otherClass, BiJoiner<A,B> joiner1, BiJoiner<A,B> joiner2, BiJoiner<A,B> joiner3, BiJoiner<A,B> joiner4)As defined byifExistsIncludingNullVars(Class, BiJoiner).default UniConstraintStream<A>ifExistsOther(Class<A> otherClass)Create a newUniConstraintStreamfor every A, if another A exists that does notObject.equals(Object)the first.default UniConstraintStream<A>ifExistsOther(Class<A> otherClass, BiJoiner<A,A> joiner)Create a newUniConstraintStreamfor every A, if another A exists that does notObject.equals(Object)the first, and for which theBiJoineris true (for the properties it extracts from both facts).default UniConstraintStream<A>ifExistsOther(Class<A> otherClass, BiJoiner<A,A>... joiners)As defined byifExistsOther(Class, BiJoiner).default UniConstraintStream<A>ifExistsOther(Class<A> otherClass, BiJoiner<A,A> joiner1, BiJoiner<A,A> joiner2)As defined byifExistsOther(Class, BiJoiner).default UniConstraintStream<A>ifExistsOther(Class<A> otherClass, BiJoiner<A,A> joiner1, BiJoiner<A,A> joiner2, BiJoiner<A,A> joiner3)As defined byifExistsOther(Class, BiJoiner).default UniConstraintStream<A>ifExistsOther(Class<A> otherClass, BiJoiner<A,A> joiner1, BiJoiner<A,A> joiner2, BiJoiner<A,A> joiner3, BiJoiner<A,A> joiner4)As defined byifExistsOther(Class, BiJoiner).default UniConstraintStream<A>ifExistsOtherIncludingNullVars(Class<A> otherClass)Create a newUniConstraintStreamfor every A, if another A exists that does notObject.equals(Object)the first.default UniConstraintStream<A>ifExistsOtherIncludingNullVars(Class<A> otherClass, BiJoiner<A,A> joiner)Create a newUniConstraintStreamfor every A, if another A exists that does notObject.equals(Object)the first, and for which theBiJoineris true (for the properties it extracts from both facts).default UniConstraintStream<A>ifExistsOtherIncludingNullVars(Class<A> otherClass, BiJoiner<A,A>... joiners)As defined byifExistsOtherIncludingNullVars(Class, BiJoiner).default UniConstraintStream<A>ifExistsOtherIncludingNullVars(Class<A> otherClass, BiJoiner<A,A> joiner1, BiJoiner<A,A> joiner2)As defined byifExistsOther(Class, BiJoiner).default UniConstraintStream<A>ifExistsOtherIncludingNullVars(Class<A> otherClass, BiJoiner<A,A> joiner1, BiJoiner<A,A> joiner2, BiJoiner<A,A> joiner3)As defined byifExistsOtherIncludingNullVars(Class, BiJoiner).default UniConstraintStream<A>ifExistsOtherIncludingNullVars(Class<A> otherClass, BiJoiner<A,A> joiner1, BiJoiner<A,A> joiner2, BiJoiner<A,A> joiner3, BiJoiner<A,A> joiner4)As defined byifExistsOtherIncludingNullVars(Class, BiJoiner).default <B> UniConstraintStream<A>ifNotExists(Class<B> otherClass, BiJoiner<A,B> joiner)Create a newUniConstraintStreamfor every A where B does not exist for which theBiJoineris true (for the properties it extracts from both facts).<B> UniConstraintStream<A>ifNotExists(Class<B> otherClass, BiJoiner<A,B>... joiners)As defined byifNotExists(Class, BiJoiner).default <B> UniConstraintStream<A>ifNotExists(Class<B> otherClass, BiJoiner<A,B> joiner1, BiJoiner<A,B> joiner2)As defined byifNotExists(Class, BiJoiner).default <B> UniConstraintStream<A>ifNotExists(Class<B> otherClass, BiJoiner<A,B> joiner1, BiJoiner<A,B> joiner2, BiJoiner<A,B> joiner3)As defined byifNotExists(Class, BiJoiner).default <B> UniConstraintStream<A>ifNotExists(Class<B> otherClass, BiJoiner<A,B> joiner1, BiJoiner<A,B> joiner2, BiJoiner<A,B> joiner3, BiJoiner<A,B> joiner4)As defined byifNotExists(Class, BiJoiner).default <B> UniConstraintStream<A>ifNotExistsIncludingNullVars(Class<B> otherClass, BiJoiner<A,B> joiner)Create a newUniConstraintStreamfor every A where B does not exist for which theBiJoineris true (for the properties it extracts from both facts).<B> UniConstraintStream<A>ifNotExistsIncludingNullVars(Class<B> otherClass, BiJoiner<A,B>... joiners)As defined byifNotExistsIncludingNullVars(Class, BiJoiner).default <B> UniConstraintStream<A>ifNotExistsIncludingNullVars(Class<B> otherClass, BiJoiner<A,B> joiner1, BiJoiner<A,B> joiner2)As defined byifNotExistsIncludingNullVars(Class, BiJoiner).default <B> UniConstraintStream<A>ifNotExistsIncludingNullVars(Class<B> otherClass, BiJoiner<A,B> joiner1, BiJoiner<A,B> joiner2, BiJoiner<A,B> joiner3)As defined byifNotExistsIncludingNullVars(Class, BiJoiner).default <B> UniConstraintStream<A>ifNotExistsIncludingNullVars(Class<B> otherClass, BiJoiner<A,B> joiner1, BiJoiner<A,B> joiner2, BiJoiner<A,B> joiner3, BiJoiner<A,B> joiner4)As defined byifNotExistsIncludingNullVars(Class, BiJoiner).default UniConstraintStream<A>ifNotExistsOther(Class<A> otherClass)Create a newUniConstraintStreamfor every A, if no other A exists that does notObject.equals(Object)the first.default UniConstraintStream<A>ifNotExistsOther(Class<A> otherClass, BiJoiner<A,A> joiner)Create a newUniConstraintStreamfor every A, if no other A exists that does notObject.equals(Object)the first, and for which theBiJoineris true (for the properties it extracts from both facts).default UniConstraintStream<A>ifNotExistsOther(Class<A> otherClass, BiJoiner<A,A>... joiners)As defined byifNotExistsOther(Class, BiJoiner).default UniConstraintStream<A>ifNotExistsOther(Class<A> otherClass, BiJoiner<A,A> joiner1, BiJoiner<A,A> joiner2)As defined byifNotExistsOther(Class, BiJoiner).default UniConstraintStream<A>ifNotExistsOther(Class<A> otherClass, BiJoiner<A,A> joiner1, BiJoiner<A,A> joiner2, BiJoiner<A,A> joiner3)As defined byifNotExistsOther(Class, BiJoiner).default UniConstraintStream<A>ifNotExistsOther(Class<A> otherClass, BiJoiner<A,A> joiner1, BiJoiner<A,A> joiner2, BiJoiner<A,A> joiner3, BiJoiner<A,A> joiner4)As defined byifNotExistsOther(Class, BiJoiner).default UniConstraintStream<A>ifNotExistsOtherIncludingNullVars(Class<A> otherClass)Create a newUniConstraintStreamfor every A, if no other A exists that does notObject.equals(Object)the first.default UniConstraintStream<A>ifNotExistsOtherIncludingNullVars(Class<A> otherClass, BiJoiner<A,A> joiner)Create a newUniConstraintStreamfor every A, if no other A exists that does notObject.equals(Object)the first, and for which theBiJoineris true (for the properties it extracts from both facts).default UniConstraintStream<A>ifNotExistsOtherIncludingNullVars(Class<A> otherClass, BiJoiner<A,A>... joiners)As defined byifNotExistsOtherIncludingNullVars(Class, BiJoiner).default UniConstraintStream<A>ifNotExistsOtherIncludingNullVars(Class<A> otherClass, BiJoiner<A,A> joiner1, BiJoiner<A,A> joiner2)As defined byifNotExistsOtherIncludingNullVars(Class, BiJoiner).default UniConstraintStream<A>ifNotExistsOtherIncludingNullVars(Class<A> otherClass, BiJoiner<A,A> joiner1, BiJoiner<A,A> joiner2, BiJoiner<A,A> joiner3)As defined byifNotExistsOtherIncludingNullVars(Class, BiJoiner).default UniConstraintStream<A>ifNotExistsOtherIncludingNullVars(Class<A> otherClass, BiJoiner<A,A> joiner1, BiJoiner<A,A> joiner2, BiJoiner<A,A> joiner3, BiJoiner<A,A> joiner4)As defined byifNotExistsOtherIncludingNullVars(Class, BiJoiner).default Constraintimpact(String constraintName, Score<?> constraintWeight, ToIntFunction<A> matchWeigher)Deprecated, for removal: This API element is subject to removal in a future version.Preferimpact(Score, ToIntFunction).default Constraintimpact(String constraintPackage, String constraintName, Score<?> constraintWeight, ToIntFunction<A> matchWeigher)Deprecated, for removal: This API element is subject to removal in a future version.Preferimpact(Score, ToIntFunction).default <Score_ extends Score<Score_>>
UniConstraintBuilder<A,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_>>
UniConstraintBuilder<A,Score_>impact(Score_ constraintWeight, ToIntFunction<A> 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, Function<A,BigDecimal> matchWeigher)Deprecated, for removal: This API element is subject to removal in a future version.default ConstraintimpactBigDecimal(String constraintPackage, String constraintName, Score<?> constraintWeight, Function<A,BigDecimal> matchWeigher)Deprecated, for removal: This API element is subject to removal in a future version.<Score_ extends Score<Score_>>
UniConstraintBuilder<A,Score_>impactBigDecimal(Score_ constraintWeight, Function<A,BigDecimal> matchWeigher)As defined byimpact(Score, ToIntFunction), with an impact of typeBigDecimal.default UniConstraintBuilder<A,?>impactConfigurable()Positively impacts theScoreby theConstraintWeightfor each match, and returns a builder to apply optional constraint properties.default ConstraintimpactConfigurable(String constraintPackage, String constraintName, ToIntFunction<A> matchWeigher)Deprecated, for removal: This API element is subject to removal in a future version.default ConstraintimpactConfigurable(String constraintName, ToIntFunction<A> matchWeigher)Deprecated, for removal: This API element is subject to removal in a future version.UniConstraintBuilder<A,?>impactConfigurable(ToIntFunction<A> 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, Function<A,BigDecimal> matchWeigher)Deprecated, for removal: This API element is subject to removal in a future version.default ConstraintimpactConfigurableBigDecimal(String constraintName, Function<A,BigDecimal> matchWeigher)Deprecated, for removal: This API element is subject to removal in a future version.UniConstraintBuilder<A,?>impactConfigurableBigDecimal(Function<A,BigDecimal> matchWeigher)As defined byimpactConfigurable(ToIntFunction), with an impact of type BigDecimal.default ConstraintimpactConfigurableLong(String constraintPackage, String constraintName, ToLongFunction<A> matchWeigher)Deprecated, for removal: This API element is subject to removal in a future version.default ConstraintimpactConfigurableLong(String constraintName, ToLongFunction<A> matchWeigher)Deprecated, for removal: This API element is subject to removal in a future version.UniConstraintBuilder<A,?>impactConfigurableLong(ToLongFunction<A> matchWeigher)As defined byimpactConfigurable(ToIntFunction), with an impact of type long.default ConstraintimpactLong(String constraintName, Score<?> constraintWeight, ToLongFunction<A> matchWeigher)Deprecated, for removal: This API element is subject to removal in a future version.default ConstraintimpactLong(String constraintPackage, String constraintName, Score<?> constraintWeight, ToLongFunction<A> matchWeigher)Deprecated, for removal: This API element is subject to removal in a future version.<Score_ extends Score<Score_>>
UniConstraintBuilder<A,Score_>impactLong(Score_ constraintWeight, ToLongFunction<A> matchWeigher)As defined byimpact(Score, ToIntFunction), with an impact of type long.default <B> BiConstraintStream<A,B>join(UniConstraintStream<B> otherStream)Create a newBiConstraintStreamfor every combination of A and B.default <B> BiConstraintStream<A,B>join(UniConstraintStream<B> otherStream, BiJoiner<A,B> joiner)Create a newBiConstraintStreamfor every combination of A and B for which theBiJoineris true (for the properties it extracts from both facts).<B> BiConstraintStream<A,B>join(UniConstraintStream<B> otherStream, BiJoiner<A,B>... joiners)As defined byjoin(UniConstraintStream, BiJoiner).default <B> BiConstraintStream<A,B>join(UniConstraintStream<B> otherStream, BiJoiner<A,B> joiner1, BiJoiner<A,B> joiner2)As defined byjoin(UniConstraintStream, BiJoiner).default <B> BiConstraintStream<A,B>join(UniConstraintStream<B> otherStream, BiJoiner<A,B> joiner1, BiJoiner<A,B> joiner2, BiJoiner<A,B> joiner3)As defined byjoin(UniConstraintStream, BiJoiner).default <B> BiConstraintStream<A,B>join(UniConstraintStream<B> otherStream, BiJoiner<A,B> joiner1, BiJoiner<A,B> joiner2, BiJoiner<A,B> joiner3, BiJoiner<A,B> joiner4)As defined byjoin(UniConstraintStream, BiJoiner).default <B> BiConstraintStream<A,B>join(Class<B> otherClass)Create a newBiConstraintStreamfor every combination of A and B.default <B> BiConstraintStream<A,B>join(Class<B> otherClass, BiJoiner<A,B> joiner)Create a newBiConstraintStreamfor every combination of A and B for which theBiJoineris true (for the properties it extracts from both facts).<B> BiConstraintStream<A,B>join(Class<B> otherClass, BiJoiner<A,B>... joiners)As defined byjoin(Class, BiJoiner).default <B> BiConstraintStream<A,B>join(Class<B> otherClass, BiJoiner<A,B> joiner1, BiJoiner<A,B> joiner2)As defined byjoin(Class, BiJoiner).default <B> BiConstraintStream<A,B>join(Class<B> otherClass, BiJoiner<A,B> joiner1, BiJoiner<A,B> joiner2, BiJoiner<A,B> joiner3)As defined byjoin(Class, BiJoiner).default <B> BiConstraintStream<A,B>join(Class<B> otherClass, BiJoiner<A,B> joiner1, BiJoiner<A,B> joiner2, BiJoiner<A,B> joiner3, BiJoiner<A,B> joiner4)As defined byjoin(Class, BiJoiner).<ResultA_> UniConstraintStream<ResultA_>map(Function<A,ResultA_> mapping)Transforms the stream in such a way that tuples are remapped using the given function.default Constraintpenalize(String constraintName, Score<?> constraintWeight, ToIntFunction<A> matchWeigher)Deprecated, for removal: This API element is subject to removal in a future version.Preferpenalize(Score, ToIntFunction).default Constraintpenalize(String constraintPackage, String constraintName, Score<?> constraintWeight, ToIntFunction<A> matchWeigher)Deprecated, for removal: This API element is subject to removal in a future version.Preferpenalize(Score, ToIntFunction).default <Score_ extends Score<Score_>>
UniConstraintBuilder<A,Score_>penalize(Score_ constraintWeight)As defined bypenalize(Score, ToIntFunction), where the match weight is one (1).<Score_ extends Score<Score_>>
UniConstraintBuilder<A,Score_>penalize(Score_ constraintWeight, ToIntFunction<A> 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, Function<A,BigDecimal> matchWeigher)Deprecated, for removal: This API element is subject to removal in a future version.default ConstraintpenalizeBigDecimal(String constraintPackage, String constraintName, Score<?> constraintWeight, Function<A,BigDecimal> matchWeigher)Deprecated, for removal: This API element is subject to removal in a future version.<Score_ extends Score<Score_>>
UniConstraintBuilder<A,Score_>penalizeBigDecimal(Score_ constraintWeight, Function<A,BigDecimal> matchWeigher)As defined bypenalize(Score, ToIntFunction), with a penalty of typeBigDecimal.default UniConstraintBuilder<A,?>penalizeConfigurable()Negatively impacts theScore, subtracting theConstraintWeightfor each match, and returns a builder to apply optional constraint properties.default ConstraintpenalizeConfigurable(String constraintPackage, String constraintName, ToIntFunction<A> matchWeigher)Deprecated, for removal: This API element is subject to removal in a future version.default ConstraintpenalizeConfigurable(String constraintName, ToIntFunction<A> matchWeigher)Deprecated, for removal: This API element is subject to removal in a future version.UniConstraintBuilder<A,?>penalizeConfigurable(ToIntFunction<A> 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, Function<A,BigDecimal> matchWeigher)Deprecated, for removal: This API element is subject to removal in a future version.default ConstraintpenalizeConfigurableBigDecimal(String constraintName, Function<A,BigDecimal> matchWeigher)Deprecated, for removal: This API element is subject to removal in a future version.UniConstraintBuilder<A,?>penalizeConfigurableBigDecimal(Function<A,BigDecimal> matchWeigher)As defined bypenalizeConfigurable(ToIntFunction), with a penalty of typeBigDecimal.default ConstraintpenalizeConfigurableLong(String constraintPackage, String constraintName, ToLongFunction<A> matchWeigher)Deprecated, for removal: This API element is subject to removal in a future version.default ConstraintpenalizeConfigurableLong(String constraintName, ToLongFunction<A> matchWeigher)Deprecated, for removal: This API element is subject to removal in a future version.UniConstraintBuilder<A,?>penalizeConfigurableLong(ToLongFunction<A> matchWeigher)As defined bypenalizeConfigurable(ToIntFunction), with a penalty of type long.default ConstraintpenalizeLong(String constraintName, Score<?> constraintWeight, ToLongFunction<A> matchWeigher)Deprecated, for removal: This API element is subject to removal in a future version.default ConstraintpenalizeLong(String constraintPackage, String constraintName, Score<?> constraintWeight, ToLongFunction<A> matchWeigher)Deprecated, for removal: This API element is subject to removal in a future version.<Score_ extends Score<Score_>>
UniConstraintBuilder<A,Score_>penalizeLong(Score_ constraintWeight, ToLongFunction<A> matchWeigher)As defined bypenalize(Score, ToIntFunction), with a penalty of type long.default Constraintreward(String constraintName, Score<?> constraintWeight, ToIntFunction<A> matchWeigher)Deprecated, for removal: This API element is subject to removal in a future version.Preferreward(Score, ToIntFunction).default Constraintreward(String constraintPackage, String constraintName, Score<?> constraintWeight, ToIntFunction<A> matchWeigher)Deprecated, for removal: This API element is subject to removal in a future version.Preferreward(Score, ToIntFunction).default <Score_ extends Score<Score_>>
UniConstraintBuilder<A,Score_>reward(Score_ constraintWeight)As defined byreward(Score, ToIntFunction), where the match weight is one (1).<Score_ extends Score<Score_>>
UniConstraintBuilder<A,Score_>reward(Score_ constraintWeight, ToIntFunction<A> 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, Function<A,BigDecimal> matchWeigher)Deprecated, for removal: This API element is subject to removal in a future version.default ConstraintrewardBigDecimal(String constraintPackage, String constraintName, Score<?> constraintWeight, Function<A,BigDecimal> matchWeigher)Deprecated, for removal: This API element is subject to removal in a future version.<Score_ extends Score<Score_>>
UniConstraintBuilder<A,Score_>rewardBigDecimal(Score_ constraintWeight, Function<A,BigDecimal> matchWeigher)As defined byreward(Score, ToIntFunction), with a penalty of typeBigDecimal.default UniConstraintBuilder<A,?>rewardConfigurable()Positively impacts theScore, adding theConstraintWeightfor each match, and returns a builder to apply optional constraint properties.default ConstraintrewardConfigurable(String constraintPackage, String constraintName, ToIntFunction<A> matchWeigher)Deprecated, for removal: This API element is subject to removal in a future version.default ConstraintrewardConfigurable(String constraintName, ToIntFunction<A> matchWeigher)Deprecated, for removal: This API element is subject to removal in a future version.UniConstraintBuilder<A,?>rewardConfigurable(ToIntFunction<A> 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, Function<A,BigDecimal> matchWeigher)Deprecated, for removal: This API element is subject to removal in a future version.default ConstraintrewardConfigurableBigDecimal(String constraintName, Function<A,BigDecimal> matchWeigher)Deprecated, for removal: This API element is subject to removal in a future version.UniConstraintBuilder<A,?>rewardConfigurableBigDecimal(Function<A,BigDecimal> matchWeigher)As defined byrewardConfigurable(ToIntFunction), with a penalty of typeBigDecimal.default ConstraintrewardConfigurableLong(String constraintPackage, String constraintName, ToLongFunction<A> matchWeigher)Deprecated, for removal: This API element is subject to removal in a future version.default ConstraintrewardConfigurableLong(String constraintName, ToLongFunction<A> matchWeigher)Deprecated, for removal: This API element is subject to removal in a future version.UniConstraintBuilder<A,?>rewardConfigurableLong(ToLongFunction<A> matchWeigher)As defined byrewardConfigurable(ToIntFunction), with a penalty of type long.default ConstraintrewardLong(String constraintName, Score<?> constraintWeight, ToLongFunction<A> matchWeigher)Deprecated, for removal: This API element is subject to removal in a future version.default ConstraintrewardLong(String constraintPackage, String constraintName, Score<?> constraintWeight, ToLongFunction<A> matchWeigher)Deprecated, for removal: This API element is subject to removal in a future version.<Score_ extends Score<Score_>>
UniConstraintBuilder<A,Score_>rewardLong(Score_ constraintWeight, ToLongFunction<A> matchWeigher)As defined byreward(Score, ToIntFunction), 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
UniConstraintStream<A> filter(Predicate<A> predicate)
Exhaustively test each fact against thePredicateand match ifPredicate.test(Object)returns true.- Parameters:
predicate- never null- Returns:
- never null
-
join
default <B> BiConstraintStream<A,B> join(UniConstraintStream<B> otherStream)
Create a newBiConstraintStreamfor every combination of A and B.Important:
Filteringthis is slower and less scalable than ajoin(UniConstraintStream, BiJoiner), because it doesn't apply hashing and/or indexing on the properties, so it creates and checks every combination of A and B.- Type Parameters:
B- the type of the second matched fact- Parameters:
otherStream- never null- Returns:
- never null, a stream that matches every combination of A and B
-
join
default <B> BiConstraintStream<A,B> join(UniConstraintStream<B> otherStream, BiJoiner<A,B> joiner)
Create a newBiConstraintStreamfor every combination of A and B for which theBiJoineris 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 and B.- Type Parameters:
B- the type of the second matched fact- Parameters:
otherStream- never nulljoiner- never null- Returns:
- never null, a stream that matches every combination of A and B for which the
BiJoineris true
-
join
default <B> BiConstraintStream<A,B> join(UniConstraintStream<B> otherStream, BiJoiner<A,B> joiner1, BiJoiner<A,B> joiner2)
As defined byjoin(UniConstraintStream, BiJoiner). For performance reasons, indexing joiners must be placed before filtering joiners.- Type Parameters:
B- the type of the second matched fact- Parameters:
otherStream- never nulljoiner1- never nulljoiner2- never null- Returns:
- never null, a stream that matches every combination of A and B for which all the
joinersare true
-
join
default <B> BiConstraintStream<A,B> join(UniConstraintStream<B> otherStream, BiJoiner<A,B> joiner1, BiJoiner<A,B> joiner2, BiJoiner<A,B> joiner3)
As defined byjoin(UniConstraintStream, BiJoiner). For performance reasons, indexing joiners must be placed before filtering joiners.- Type Parameters:
B- the type of the second matched fact- Parameters:
otherStream- never nulljoiner1- never nulljoiner2- never nulljoiner3- never null- Returns:
- never null, a stream that matches every combination of A and B for which all the
joinersare true
-
join
default <B> BiConstraintStream<A,B> join(UniConstraintStream<B> otherStream, BiJoiner<A,B> joiner1, BiJoiner<A,B> joiner2, BiJoiner<A,B> joiner3, BiJoiner<A,B> joiner4)
As defined byjoin(UniConstraintStream, BiJoiner). For performance reasons, indexing joiners must be placed before filtering joiners.- Type Parameters:
B- the type of the second 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 and B for which all the
joinersare true
-
join
<B> BiConstraintStream<A,B> join(UniConstraintStream<B> otherStream, BiJoiner<A,B>... joiners)
As defined byjoin(UniConstraintStream, BiJoiner). If multipleBiJoiners are provided, for performance reasons, the 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:
B- the type of the second matched fact- Parameters:
otherStream- never nulljoiners- never null- Returns:
- never null, a stream that matches every combination of A and B for which all the
joinersare true
-
join
default <B> BiConstraintStream<A,B> join(Class<B> otherClass)
Create a newBiConstraintStreamfor every combination of A and B.Important:
Filteringthis is slower and less scalable than ajoin(Class, BiJoiner), because it doesn't apply hashing and/or indexing on the properties, so it creates and checks every combination of A and B.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 and B.Note that, if a legacy constraint stream uses
ConstraintFactory.from(Class)as opposed toConstraintFactory.forEach(Class), a different range of B may be selected. (SeeConstraintFactory.from(Class)Javadoc.)This method is syntactic sugar for
join(UniConstraintStream).- Type Parameters:
B- the type of the second matched fact- Parameters:
otherClass- never null- Returns:
- never null, a stream that matches every combination of A and B
-
join
default <B> BiConstraintStream<A,B> join(Class<B> otherClass, BiJoiner<A,B> joiner)
Create a newBiConstraintStreamfor every combination of A and B for which theBiJoineris 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 and B.Note that, if a legacy constraint stream uses
ConstraintFactory.from(Class)as opposed toConstraintFactory.forEach(Class), a different range of B may be selected. (SeeConstraintFactory.from(Class)Javadoc.)This method is syntactic sugar for
join(UniConstraintStream, BiJoiner).This method has overloaded methods with multiple
BiJoinerparameters.- Type Parameters:
B- the type of the second matched fact- Parameters:
otherClass- never nulljoiner- never null- Returns:
- never null, a stream that matches every combination of A and B for which the
BiJoineris true
-
join
default <B> BiConstraintStream<A,B> join(Class<B> otherClass, BiJoiner<A,B> joiner1, BiJoiner<A,B> joiner2)
As defined byjoin(Class, BiJoiner). For performance reasons, indexing joiners must be placed before filtering joiners.- Type Parameters:
B- the type of the second matched fact- Parameters:
otherClass- never nulljoiner1- never nulljoiner2- never null- Returns:
- never null, a stream that matches every combination of A and B for which all the
joinersare true
-
join
default <B> BiConstraintStream<A,B> join(Class<B> otherClass, BiJoiner<A,B> joiner1, BiJoiner<A,B> joiner2, BiJoiner<A,B> joiner3)
As defined byjoin(Class, BiJoiner). For performance reasons, indexing joiners must be placed before filtering joiners.- Type Parameters:
B- the type of the second matched fact- Parameters:
otherClass- never nulljoiner1- never nulljoiner2- never nulljoiner3- never null- Returns:
- never null, a stream that matches every combination of A and B for which all the
joinersare true
-
join
default <B> BiConstraintStream<A,B> join(Class<B> otherClass, BiJoiner<A,B> joiner1, BiJoiner<A,B> joiner2, BiJoiner<A,B> joiner3, BiJoiner<A,B> joiner4)
As defined byjoin(Class, BiJoiner). For performance reasons, indexing joiners must be placed before filtering joiners.- Type Parameters:
B- the type of the second 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 and B for which all the
joinersare true
-
join
<B> BiConstraintStream<A,B> join(Class<B> otherClass, BiJoiner<A,B>... joiners)
As defined byjoin(Class, BiJoiner). For performance reasons, the 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:
B- the type of the second matched fact- Parameters:
otherClass- never nulljoiners- never null- Returns:
- never null, a stream that matches every combination of A and B for which all the
joinersare true
-
ifExists
default <B> UniConstraintStream<A> ifExists(Class<B> otherClass, BiJoiner<A,B> joiner)
Create a newUniConstraintStreamfor every A where B exists for which theBiJoineris true (for the properties it extracts from both facts).This method has overloaded methods with multiple
BiJoinerparameters.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:
B- the type of the second matched fact- Parameters:
otherClass- never nulljoiner- never null- Returns:
- never null, a stream that matches every A where B exists for which the
BiJoineris true
-
ifExists
default <B> UniConstraintStream<A> ifExists(Class<B> otherClass, BiJoiner<A,B> joiner1, BiJoiner<A,B> joiner2)
As defined byifExists(Class, BiJoiner). For performance reasons, indexing joiners must be placed before filtering joiners.- Type Parameters:
B- the type of the second matched fact- Parameters:
otherClass- never nulljoiner1- never nulljoiner2- never null- Returns:
- never null, a stream that matches every A where B exists for which all the
BiJoiners are true
-
ifExists
default <B> UniConstraintStream<A> ifExists(Class<B> otherClass, BiJoiner<A,B> joiner1, BiJoiner<A,B> joiner2, BiJoiner<A,B> joiner3)
As defined byifExists(Class, BiJoiner). For performance reasons, indexing joiners must be placed before filtering joiners.- Type Parameters:
B- the type of the second matched fact- Parameters:
otherClass- never nulljoiner1- never nulljoiner2- never nulljoiner3- never null- Returns:
- never null, a stream that matches every A where B exists for which all the
BiJoiners are true
-
ifExists
default <B> UniConstraintStream<A> ifExists(Class<B> otherClass, BiJoiner<A,B> joiner1, BiJoiner<A,B> joiner2, BiJoiner<A,B> joiner3, BiJoiner<A,B> joiner4)
As defined byifExists(Class, BiJoiner). For performance reasons, indexing joiners must be placed before filtering joiners.- Type Parameters:
B- the type of the second matched fact- Parameters:
otherClass- never nulljoiner1- never nulljoiner2- never nulljoiner3- never nulljoiner4- never null- Returns:
- never null, a stream that matches every A where B exists for which all the
BiJoiners are true
-
ifExists
<B> UniConstraintStream<A> ifExists(Class<B> otherClass, BiJoiner<A,B>... joiners)
As defined byifExists(Class, BiJoiner). 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:
B- the type of the second matched fact- Parameters:
otherClass- never nulljoiners- never null- Returns:
- never null, a stream that matches every A where B exists for which all the
BiJoiners are true
-
ifExistsIncludingNullVars
default <B> UniConstraintStream<A> ifExistsIncludingNullVars(Class<B> otherClass, BiJoiner<A,B> joiner)
Create a newUniConstraintStreamfor every A where B exists for which theBiJoineris true (for the properties it extracts from both facts). For classes annotated withPlanningEntity, this method also includes instances with null variables.This method has overloaded methods with multiple
BiJoinerparameters.- Type Parameters:
B- the type of the second matched fact- Parameters:
otherClass- never nulljoiner- never null- Returns:
- never null, a stream that matches every A where B exists for which the
BiJoineris true
-
ifExistsIncludingNullVars
default <B> UniConstraintStream<A> ifExistsIncludingNullVars(Class<B> otherClass, BiJoiner<A,B> joiner1, BiJoiner<A,B> joiner2)
As defined byifExistsIncludingNullVars(Class, BiJoiner). For performance reasons, indexing joiners must be placed before filtering joiners.- Type Parameters:
B- the type of the second matched fact- Parameters:
otherClass- never nulljoiner1- never nulljoiner2- never null- Returns:
- never null, a stream that matches every A where B exists for which all the
BiJoiners are true
-
ifExistsIncludingNullVars
default <B> UniConstraintStream<A> ifExistsIncludingNullVars(Class<B> otherClass, BiJoiner<A,B> joiner1, BiJoiner<A,B> joiner2, BiJoiner<A,B> joiner3)
As defined byifExistsIncludingNullVars(Class, BiJoiner). For performance reasons, indexing joiners must be placed before filtering joiners.- Type Parameters:
B- the type of the second matched fact- Parameters:
otherClass- never nulljoiner1- never nulljoiner2- never nulljoiner3- never null- Returns:
- never null, a stream that matches every A where B exists for which all the
BiJoiners are true
-
ifExistsIncludingNullVars
default <B> UniConstraintStream<A> ifExistsIncludingNullVars(Class<B> otherClass, BiJoiner<A,B> joiner1, BiJoiner<A,B> joiner2, BiJoiner<A,B> joiner3, BiJoiner<A,B> joiner4)
As defined byifExistsIncludingNullVars(Class, BiJoiner). For performance reasons, indexing joiners must be placed before filtering joiners.- Type Parameters:
B- the type of the second matched fact- Parameters:
otherClass- never nulljoiner1- never nulljoiner2- never nulljoiner3- never nulljoiner4- never null- Returns:
- never null, a stream that matches every A where B exists for which all the
BiJoiners are true
-
ifExistsIncludingNullVars
<B> UniConstraintStream<A> ifExistsIncludingNullVars(Class<B> otherClass, BiJoiner<A,B>... joiners)
As defined byifExistsIncludingNullVars(Class, BiJoiner). 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:
B- the type of the second matched fact- Parameters:
otherClass- never nulljoiners- never null- Returns:
- never null, a stream that matches every A where B exists for which all the
BiJoiners are true
-
ifExistsOther
default UniConstraintStream<A> ifExistsOther(Class<A> otherClass)
Create a newUniConstraintStreamfor every A, if another A exists that does notObject.equals(Object)the first.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.)- Parameters:
otherClass- never null- Returns:
- never null, a stream that matches every A where a different A exists
-
ifExistsOther
default UniConstraintStream<A> ifExistsOther(Class<A> otherClass, BiJoiner<A,A> joiner)
Create a newUniConstraintStreamfor every A, if another A exists that does notObject.equals(Object)the first, and for which theBiJoineris true (for the properties it extracts from both facts).This method has overloaded methods with multiple
BiJoinerparameters.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.)- Parameters:
otherClass- never nulljoiner- never null- Returns:
- never null, a stream that matches every A where a different A exists for which the
BiJoineris true
-
ifExistsOther
default UniConstraintStream<A> ifExistsOther(Class<A> otherClass, BiJoiner<A,A> joiner1, BiJoiner<A,A> joiner2)
As defined byifExistsOther(Class, BiJoiner). For performance reasons, indexing joiners must be placed before filtering joiners.- Parameters:
otherClass- never nulljoiner1- never nulljoiner2- never null- Returns:
- never null, a stream that matches every A where a different A exists for which all the
BiJoiners are true
-
ifExistsOther
default UniConstraintStream<A> ifExistsOther(Class<A> otherClass, BiJoiner<A,A> joiner1, BiJoiner<A,A> joiner2, BiJoiner<A,A> joiner3)
As defined byifExistsOther(Class, BiJoiner). For performance reasons, indexing joiners must be placed before filtering joiners.- Parameters:
otherClass- never nulljoiner1- never nulljoiner2- never nulljoiner3- never null- Returns:
- never null, a stream that matches every A where a different A exists for which all the
BiJoiners are true
-
ifExistsOther
default UniConstraintStream<A> ifExistsOther(Class<A> otherClass, BiJoiner<A,A> joiner1, BiJoiner<A,A> joiner2, BiJoiner<A,A> joiner3, BiJoiner<A,A> joiner4)
As defined byifExistsOther(Class, BiJoiner). For performance reasons, indexing joiners must be placed before filtering joiners.- Parameters:
otherClass- never nulljoiner1- never nulljoiner2- never nulljoiner3- never nulljoiner4- never null- Returns:
- never null, a stream that matches every A where a different A exists for which all the
BiJoiners are true
-
ifExistsOther
default UniConstraintStream<A> ifExistsOther(Class<A> otherClass, BiJoiner<A,A>... joiners)
As defined byifExistsOther(Class, BiJoiner). For performance reasons, the 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.- Parameters:
otherClass- never nulljoiners- never null- Returns:
- never null, a stream that matches every A where a different A exists for which all the
BiJoiners are true
-
ifExistsOtherIncludingNullVars
default UniConstraintStream<A> ifExistsOtherIncludingNullVars(Class<A> otherClass)
Create a newUniConstraintStreamfor every A, if another A exists that does notObject.equals(Object)the first. For classes annotated withPlanningEntity, this method also includes instances with null variables.- Parameters:
otherClass- never null- Returns:
- never null, a stream that matches every A where a different A exists
-
ifExistsOtherIncludingNullVars
default UniConstraintStream<A> ifExistsOtherIncludingNullVars(Class<A> otherClass, BiJoiner<A,A> joiner)
Create a newUniConstraintStreamfor every A, if another A exists that does notObject.equals(Object)the first, and for which theBiJoineris true (for the properties it extracts from both facts). For classes annotated withPlanningEntity, this method also includes instances with null variables.This method has overloaded methods with multiple
BiJoinerparameters.- Parameters:
otherClass- never nulljoiner- never null- Returns:
- never null, a stream that matches every A where a different A exists for which the
BiJoineris true
-
ifExistsOtherIncludingNullVars
default UniConstraintStream<A> ifExistsOtherIncludingNullVars(Class<A> otherClass, BiJoiner<A,A> joiner1, BiJoiner<A,A> joiner2)
As defined byifExistsOther(Class, BiJoiner). For performance reasons, indexing joiners must be placed before filtering joiners.- Parameters:
otherClass- never nulljoiner1- never nulljoiner2- never null- Returns:
- never null, a stream that matches every A where a different A exists for which all the
BiJoiners are true
-
ifExistsOtherIncludingNullVars
default UniConstraintStream<A> ifExistsOtherIncludingNullVars(Class<A> otherClass, BiJoiner<A,A> joiner1, BiJoiner<A,A> joiner2, BiJoiner<A,A> joiner3)
As defined byifExistsOtherIncludingNullVars(Class, BiJoiner). For performance reasons, indexing joiners must be placed before filtering joiners.- Parameters:
otherClass- never nulljoiner1- never nulljoiner2- never nulljoiner3- never null- Returns:
- never null, a stream that matches every A where a different A exists for which all the
BiJoiners are true
-
ifExistsOtherIncludingNullVars
default UniConstraintStream<A> ifExistsOtherIncludingNullVars(Class<A> otherClass, BiJoiner<A,A> joiner1, BiJoiner<A,A> joiner2, BiJoiner<A,A> joiner3, BiJoiner<A,A> joiner4)
As defined byifExistsOtherIncludingNullVars(Class, BiJoiner). For performance reasons, indexing joiners must be placed before filtering joiners.- Parameters:
otherClass- never nulljoiner1- never nulljoiner2- never nulljoiner3- never nulljoiner4- never null- Returns:
- never null, a stream that matches every A where a different A exists for which all the
BiJoiners are true
-
ifExistsOtherIncludingNullVars
default UniConstraintStream<A> ifExistsOtherIncludingNullVars(Class<A> otherClass, BiJoiner<A,A>... joiners)
As defined byifExistsOtherIncludingNullVars(Class, BiJoiner). If multipleBiJoiners are provided, for performance reasons, the 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.- Parameters:
otherClass- never nulljoiners- never null- Returns:
- never null, a stream that matches every A where a different A exists for which all the
BiJoiners are true
-
ifNotExists
default <B> UniConstraintStream<A> ifNotExists(Class<B> otherClass, BiJoiner<A,B> joiner)
Create a newUniConstraintStreamfor every A where B does not exist for which theBiJoineris true (for the properties it extracts from both facts).This method has overloaded methods with multiple
BiJoinerparameters.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:
B- the type of the second matched fact- Parameters:
otherClass- never nulljoiner- never null- Returns:
- never null, a stream that matches every A where B does not exist for which the
BiJoineris true
-
ifNotExists
default <B> UniConstraintStream<A> ifNotExists(Class<B> otherClass, BiJoiner<A,B> joiner1, BiJoiner<A,B> joiner2)
As defined byifNotExists(Class, BiJoiner). For performance reasons, indexing joiners must be placed before filtering joiners.- Type Parameters:
B- the type of the second matched fact- Parameters:
otherClass- never nulljoiner1- never nulljoiner2- never null- Returns:
- never null, a stream that matches every A where B does not exist for which all the
BiJoiners are true
-
ifNotExists
default <B> UniConstraintStream<A> ifNotExists(Class<B> otherClass, BiJoiner<A,B> joiner1, BiJoiner<A,B> joiner2, BiJoiner<A,B> joiner3)
As defined byifNotExists(Class, BiJoiner). For performance reasons, indexing joiners must be placed before filtering joiners.- Type Parameters:
B- the type of the second matched fact- Parameters:
otherClass- never nulljoiner1- never nulljoiner2- never nulljoiner3- never null- Returns:
- never null, a stream that matches every A where B does not exist for which all the
BiJoiners are true
-
ifNotExists
default <B> UniConstraintStream<A> ifNotExists(Class<B> otherClass, BiJoiner<A,B> joiner1, BiJoiner<A,B> joiner2, BiJoiner<A,B> joiner3, BiJoiner<A,B> joiner4)
As defined byifNotExists(Class, BiJoiner). For performance reasons, indexing joiners must be placed before filtering joiners.- Type Parameters:
B- the type of the second matched fact- Parameters:
otherClass- never nulljoiner1- never nulljoiner2- never nulljoiner3- never nulljoiner4- never null- Returns:
- never null, a stream that matches every A where B does not exist for which all the
BiJoiners are true
-
ifNotExists
<B> UniConstraintStream<A> ifNotExists(Class<B> otherClass, BiJoiner<A,B>... joiners)
As defined byifNotExists(Class, BiJoiner). 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:
B- the type of the second matched fact- Parameters:
otherClass- never nulljoiners- never null- Returns:
- never null, a stream that matches every A where B does not exist for which all the
BiJoiners are true
-
ifNotExistsIncludingNullVars
default <B> UniConstraintStream<A> ifNotExistsIncludingNullVars(Class<B> otherClass, BiJoiner<A,B> joiner)
Create a newUniConstraintStreamfor every A where B does not exist for which theBiJoineris true (for the properties it extracts from both facts). For classes annotated withPlanningEntity, this method also includes instances with null variables.This method has overloaded methods with multiple
BiJoinerparameters.- Type Parameters:
B- the type of the second matched fact- Parameters:
otherClass- never nulljoiner- never null- Returns:
- never null, a stream that matches every A where B does not exist for which the
BiJoineris true
-
ifNotExistsIncludingNullVars
default <B> UniConstraintStream<A> ifNotExistsIncludingNullVars(Class<B> otherClass, BiJoiner<A,B> joiner1, BiJoiner<A,B> joiner2)
As defined byifNotExistsIncludingNullVars(Class, BiJoiner). For performance reasons, indexing joiners must be placed before filtering joiners.- Type Parameters:
B- the type of the second matched fact- Parameters:
otherClass- never nulljoiner1- never nulljoiner2- never null- Returns:
- never null, a stream that matches every A where B does not exist for which all the
BiJoiners are true
-
ifNotExistsIncludingNullVars
default <B> UniConstraintStream<A> ifNotExistsIncludingNullVars(Class<B> otherClass, BiJoiner<A,B> joiner1, BiJoiner<A,B> joiner2, BiJoiner<A,B> joiner3)
As defined byifNotExistsIncludingNullVars(Class, BiJoiner). For performance reasons, indexing joiners must be placed before filtering joiners.- Type Parameters:
B- the type of the second matched fact- Parameters:
otherClass- never nulljoiner1- never nulljoiner2- never nulljoiner3- never null- Returns:
- never null, a stream that matches every A where B does not exist for which all the
BiJoiners are true
-
ifNotExistsIncludingNullVars
default <B> UniConstraintStream<A> ifNotExistsIncludingNullVars(Class<B> otherClass, BiJoiner<A,B> joiner1, BiJoiner<A,B> joiner2, BiJoiner<A,B> joiner3, BiJoiner<A,B> joiner4)
As defined byifNotExistsIncludingNullVars(Class, BiJoiner). For performance reasons, indexing joiners must be placed before filtering joiners.- Type Parameters:
B- the type of the second matched fact- Parameters:
otherClass- never nulljoiner1- never nulljoiner2- never nulljoiner3- never nulljoiner4- never null- Returns:
- never null, a stream that matches every A where B does not exist for which all the
BiJoiners are true
-
ifNotExistsIncludingNullVars
<B> UniConstraintStream<A> ifNotExistsIncludingNullVars(Class<B> otherClass, BiJoiner<A,B>... joiners)
As defined byifNotExistsIncludingNullVars(Class, BiJoiner). 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:
B- the type of the second matched fact- Parameters:
otherClass- never nulljoiners- never null- Returns:
- never null, a stream that matches every A where B does not exist for which all the
BiJoiners are true
-
ifNotExistsOther
default UniConstraintStream<A> ifNotExistsOther(Class<A> otherClass)
Create a newUniConstraintStreamfor every A, if no other A exists that does notObject.equals(Object)the first.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.)- Parameters:
otherClass- never null- Returns:
- never null, a stream that matches every A where a different A does not exist
-
ifNotExistsOther
default UniConstraintStream<A> ifNotExistsOther(Class<A> otherClass, BiJoiner<A,A> joiner)
Create a newUniConstraintStreamfor every A, if no other A exists that does notObject.equals(Object)the first, and for which theBiJoineris true (for the properties it extracts from both facts).This method has overloaded methods with multiple
BiJoinerparameters.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.)- Parameters:
otherClass- never nulljoiner- never null- Returns:
- never null, a stream that matches every A where a different A does not exist for which the
BiJoineris true
-
ifNotExistsOther
default UniConstraintStream<A> ifNotExistsOther(Class<A> otherClass, BiJoiner<A,A> joiner1, BiJoiner<A,A> joiner2)
As defined byifNotExistsOther(Class, BiJoiner). For performance reasons, indexing joiners must be placed before filtering joiners.- Parameters:
otherClass- never nulljoiner1- never nulljoiner2- never null- Returns:
- never null, a stream that matches every A where a different A does not exist for which all the
BiJoiners are true
-
ifNotExistsOther
default UniConstraintStream<A> ifNotExistsOther(Class<A> otherClass, BiJoiner<A,A> joiner1, BiJoiner<A,A> joiner2, BiJoiner<A,A> joiner3)
As defined byifNotExistsOther(Class, BiJoiner). For performance reasons, indexing joiners must be placed before filtering joiners.- Parameters:
otherClass- never nulljoiner1- never nulljoiner2- never nulljoiner3- never null- Returns:
- never null, a stream that matches every A where a different A does not exist for which all the
BiJoiners are true
-
ifNotExistsOther
default UniConstraintStream<A> ifNotExistsOther(Class<A> otherClass, BiJoiner<A,A> joiner1, BiJoiner<A,A> joiner2, BiJoiner<A,A> joiner3, BiJoiner<A,A> joiner4)
As defined byifNotExistsOther(Class, BiJoiner). For performance reasons, indexing joiners must be placed before filtering joiners.- Parameters:
otherClass- never nulljoiner1- never nulljoiner2- never nulljoiner3- never nulljoiner4- never null- Returns:
- never null, a stream that matches every A where a different A does not exist for which all the
BiJoiners are true
-
ifNotExistsOther
default UniConstraintStream<A> ifNotExistsOther(Class<A> otherClass, BiJoiner<A,A>... joiners)
As defined byifNotExistsOther(Class, BiJoiner). For performance reasons, the 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.- Parameters:
otherClass- never nulljoiners- never null- Returns:
- never null, a stream that matches every A where a different A does not exist for which all the
BiJoiners are true
-
ifNotExistsOtherIncludingNullVars
default UniConstraintStream<A> ifNotExistsOtherIncludingNullVars(Class<A> otherClass)
Create a newUniConstraintStreamfor every A, if no other A exists that does notObject.equals(Object)the first. For classes annotated withPlanningEntity, this method also includes instances with null variables.- Parameters:
otherClass- never null- Returns:
- never null, a stream that matches every A where a different A does not exist
-
ifNotExistsOtherIncludingNullVars
default UniConstraintStream<A> ifNotExistsOtherIncludingNullVars(Class<A> otherClass, BiJoiner<A,A> joiner)
Create a newUniConstraintStreamfor every A, if no other A exists that does notObject.equals(Object)the first, and for which theBiJoineris true (for the properties it extracts from both facts). For classes annotated withPlanningEntity, this method also includes instances with null variables.This method has overloaded methods with multiple
BiJoinerparameters.- Parameters:
otherClass- never nulljoiner- never null- Returns:
- never null, a stream that matches every A where a different A does not exist for which the
BiJoineris true
-
ifNotExistsOtherIncludingNullVars
default UniConstraintStream<A> ifNotExistsOtherIncludingNullVars(Class<A> otherClass, BiJoiner<A,A> joiner1, BiJoiner<A,A> joiner2)
As defined byifNotExistsOtherIncludingNullVars(Class, BiJoiner). For performance reasons, indexing joiners must be placed before filtering joiners.- Parameters:
otherClass- never nulljoiner1- never nulljoiner2- never null- Returns:
- never null, a stream that matches every A where a different A does not exist for which all the
BiJoiners are true
-
ifNotExistsOtherIncludingNullVars
default UniConstraintStream<A> ifNotExistsOtherIncludingNullVars(Class<A> otherClass, BiJoiner<A,A> joiner1, BiJoiner<A,A> joiner2, BiJoiner<A,A> joiner3)
As defined byifNotExistsOtherIncludingNullVars(Class, BiJoiner). For performance reasons, indexing joiners must be placed before filtering joiners.- Parameters:
otherClass- never nulljoiner1- never nulljoiner2- never nulljoiner3- never null- Returns:
- never null, a stream that matches every A where a different A does not exist for which all the
BiJoiners are true
-
ifNotExistsOtherIncludingNullVars
default UniConstraintStream<A> ifNotExistsOtherIncludingNullVars(Class<A> otherClass, BiJoiner<A,A> joiner1, BiJoiner<A,A> joiner2, BiJoiner<A,A> joiner3, BiJoiner<A,A> joiner4)
As defined byifNotExistsOtherIncludingNullVars(Class, BiJoiner). For performance reasons, indexing joiners must be placed before filtering joiners.- Parameters:
otherClass- never nulljoiner1- never nulljoiner2- never nulljoiner3- never nulljoiner4- never null- Returns:
- never null, a stream that matches every A where a different A does not exist for which all the
BiJoiners are true
-
ifNotExistsOtherIncludingNullVars
default UniConstraintStream<A> ifNotExistsOtherIncludingNullVars(Class<A> otherClass, BiJoiner<A,A>... joiners)
As defined byifNotExistsOtherIncludingNullVars(Class, BiJoiner). If multipleBiJoiners are provided, for performance reasons, the 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.- Parameters:
otherClass- never nulljoiners- never null- Returns:
- never null, a stream that matches every A where a different A does not exist for which all the
BiJoiners are true
-
groupBy
<ResultContainer_,Result_> UniConstraintStream<Result_> groupBy(UniConstraintCollector<A,ResultContainer_,Result_> collector)
Convert theUniConstraintStreamto a differentUniConstraintStream, containing only a single tuple, the result of applyingUniConstraintCollector.- 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(UniConstraintCollector<A,ResultContainerA_,ResultA_> collectorA, UniConstraintCollector<A,ResultContainerB_,ResultB_> collectorB)
Convert theUniConstraintStreamto aBiConstraintStream, containing only a single tuple, the result of applying twoUniConstraintCollectors.- 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(UniConstraintCollector<A,ResultContainerA_,ResultA_> collectorA, UniConstraintCollector<A,ResultContainerB_,ResultB_> collectorB, UniConstraintCollector<A,ResultContainerC_,ResultC_> collectorC)
Convert theUniConstraintStreamto aTriConstraintStream, containing only a single tuple, the result of applying threeUniConstraintCollectors.- 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(UniConstraintCollector<A,ResultContainerA_,ResultA_> collectorA, UniConstraintCollector<A,ResultContainerB_,ResultB_> collectorB, UniConstraintCollector<A,ResultContainerC_,ResultC_> collectorC, UniConstraintCollector<A,ResultContainerD_,ResultD_> collectorD)
Convert theUniConstraintStreamto aQuadConstraintStream, containing only a single tuple, the result of applying fourUniConstraintCollectors.- 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(Function<A,GroupKey_> groupKeyMapping)
Convert theUniConstraintStreamto a differentUniConstraintStream, 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; must honorthe general contract of hashCode.- 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(Function<A,GroupKey_> groupKeyMapping, UniConstraintCollector<A,ResultContainer_,Result_> collector)
Convert theUniConstraintStreamto aBiConstraintStream, consisting of unique tuples with two facts.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
UniConstraintCollectorapplied 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(Function<A,GroupKey_> groupKeyMapping, UniConstraintCollector<A,ResultContainerB_,ResultB_> collectorB, UniConstraintCollector<A,ResultContainerC_,ResultC_> collectorC)
Convert theUniConstraintStreamto 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
UniConstraintCollectorapplied 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(Function<A,GroupKey_> groupKeyMapping, UniConstraintCollector<A,ResultContainerB_,ResultB_> collectorB, UniConstraintCollector<A,ResultContainerC_,ResultC_> collectorC, UniConstraintCollector<A,ResultContainerD_,ResultD_> collectorD)
Convert theUniConstraintStreamto 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
UniConstraintCollectorapplied 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(Function<A,GroupKeyA_> groupKeyAMapping, Function<A,GroupKeyB_> groupKeyBMapping)
Convert theUniConstraintStreamto aBiConstraintStream, consisting of unique tuples with two 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.
- 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 original tuple into a first factgroupKeyBMapping- never null, function to convert the original tuple into a second fact- Returns:
- never null
-
groupBy
<GroupKeyA_,GroupKeyB_,ResultContainer_,Result_> TriConstraintStream<GroupKeyA_,GroupKeyB_,Result_> groupBy(Function<A,GroupKeyA_> groupKeyAMapping, Function<A,GroupKeyB_> groupKeyBMapping, UniConstraintCollector<A,ResultContainer_,Result_> collector)
Combines the semantics ofgroupBy(Function, Function)andgroupBy(UniConstraintCollector). That is, the first and second facts in the tuple follow thegroupBy(Function, Function)semantics, and the third fact is the result of applyingUniConstraintCollector.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(Function<A,GroupKeyA_> groupKeyAMapping, Function<A,GroupKeyB_> groupKeyBMapping, UniConstraintCollector<A,ResultContainerC_,ResultC_> collectorC, UniConstraintCollector<A,ResultContainerD_,ResultD_> collectorD)
Combines the semantics ofgroupBy(Function, Function)andgroupBy(UniConstraintCollector). That is, the first and second facts in the tuple follow thegroupBy(Function, Function)semantics. The third fact is the result of applying the firstUniConstraintCollector.finisher()on all the tuples of the originalUniConstraintStreamthat belong to the group. The fourth fact is the result of applying the secondUniConstraintCollector.finisher()on all the tuples of the originalUniConstraintStreamthat 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(Function<A,GroupKeyA_> groupKeyAMapping, Function<A,GroupKeyB_> groupKeyBMapping, Function<A,GroupKeyC_> groupKeyCMapping)
Convert theUniConstraintStreamto 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(Function<A,GroupKeyA_> groupKeyAMapping, Function<A,GroupKeyB_> groupKeyBMapping, Function<A,GroupKeyC_> groupKeyCMapping, UniConstraintCollector<A,ResultContainerD_,ResultD_> collectorD)
Combines the semantics ofgroupBy(Function, Function)andgroupBy(UniConstraintCollector). That is, the first three facts in the tuple follow thegroupBy(Function, Function)semantics. The final fact is the result of applying the firstUniConstraintCollector.finisher()on all the tuples of the originalUniConstraintStreamthat 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(Function<A,GroupKeyA_> groupKeyAMapping, Function<A,GroupKeyB_> groupKeyBMapping, Function<A,GroupKeyC_> groupKeyCMapping, Function<A,GroupKeyD_> groupKeyDMapping)
Convert theUniConstraintStreamto 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- * callingmap(Person::getAge)on such stream will produce a stream ofIntegers *[20, 25, 30],groupKeyBMapping- 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(Function<A,ResultA_> mapping)
Transforms the stream in such a way that tuples are remapped using the given function. This may produce a stream with duplicate tuples. Seedistinct()for details.There are several recommendations for implementing the mapping function:
- Purity. The mapping function should only depend on its input. That is, given the same input, it always returns the same output.
- Bijectivity.
No two input tuples should map to the same output tuple,
or to tuples that are
equal. Not following this recommendation creates a constraint stream with duplicate tuples, and may force you to usedistinct()later, which comes with a performance cost. - Immutable data carriers.
The objects returned by the mapping function should be identified by their contents and nothing else.
If two of them have contents which
equal, then they should likewiseequaland preferably be the same instance. The objects returned by the mapping function should also be immutable, meaning their contents should not be allowed to change.
Simple example: assuming a constraint stream of tuples of
Persons[Ann(age = 20), Beth(age = 25), Cathy(age = 30)], callingmap(Person::getAge)on such stream will produce a stream ofIntegers[20, 25, 30],Example with a non-bijective mapping function: assuming a constraint stream of tuples of
Persons[Ann(age = 20), Beth(age = 25), Cathy(age = 30), David(age = 30), Eric(age = 20)], callingmap(Person::getAge)on such stream will produce a stream ofIntegers[20, 25, 30, 30, 20].- 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
<ResultA_> UniConstraintStream<ResultA_> flattenLast(Function<A,Iterable<ResultA_>> mapping)
Takes each tuple and applies a mapping on it, which turns the tuple into aIterable. Returns a constraint stream consisting of contents of those iterables. This may produce a stream with duplicate tuples. Seedistinct()for details.In cases where the original tuple is already an
Iterable, useFunction.identity()as the argument.Simple example: assuming a constraint stream of tuples of
Persons[Ann(roles = [USER, ADMIN]]), Beth(roles = [USER]), Cathy(roles = [ADMIN, AUDITOR])], callingflattenLast(Person::getRoles)on such stream will produce a stream of[USER, ADMIN, USER, ADMIN, AUDITOR].- Type Parameters:
ResultA_- the type of facts 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 original tuple intoIterable- Returns:
- never null
-
distinct
UniConstraintStream<A> distinct()
Transforms the stream in such a way that all the tuples going through it are distinct. (No two tuples willequal.)By default, tuples going through a constraint stream are distinct. However, operations such as
map(Function)may create a stream which breaks that promise. By calling this method on such a stream, duplicate copies of the same tuple will be omitted at a performance cost.- Returns:
- never null
-
penalize
default <Score_ extends Score<Score_>> UniConstraintBuilder<A,Score_> penalize(Score_ constraintWeight)
As defined bypenalize(Score, ToIntFunction), where the match weight is one (1).- Returns:
- never null
-
penalize
<Score_ extends Score<Score_>> UniConstraintBuilder<A,Score_> penalize(Score_ constraintWeight, ToIntFunction<A> 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, ToLongFunction)orpenalizeBigDecimal(Score, Function)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_>> UniConstraintBuilder<A,Score_> penalizeLong(Score_ constraintWeight, ToLongFunction<A> matchWeigher)
As defined bypenalize(Score, ToIntFunction), with a penalty of type long.
-
penalizeBigDecimal
<Score_ extends Score<Score_>> UniConstraintBuilder<A,Score_> penalizeBigDecimal(Score_ constraintWeight, Function<A,BigDecimal> matchWeigher)
As defined bypenalize(Score, ToIntFunction), with a penalty of typeBigDecimal.
-
penalizeConfigurable
default UniConstraintBuilder<A,?> 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
UniConstraintBuilder<A,?> penalizeConfigurable(ToIntFunction<A> 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, ToIntFunction)instead.- Parameters:
matchWeigher- never null, the result of this function (matchWeight) is multiplied by the constraintWeight- Returns:
- never null
-
penalizeConfigurableLong
UniConstraintBuilder<A,?> penalizeConfigurableLong(ToLongFunction<A> matchWeigher)
As defined bypenalizeConfigurable(ToIntFunction), with a penalty of type long.If there is no
ConstraintConfiguration, usepenalizeLong(Score, ToLongFunction)instead.
-
penalizeConfigurableBigDecimal
UniConstraintBuilder<A,?> penalizeConfigurableBigDecimal(Function<A,BigDecimal> matchWeigher)
As defined bypenalizeConfigurable(ToIntFunction), with a penalty of typeBigDecimal.If there is no
ConstraintConfiguration, usepenalizeBigDecimal(Score, Function)instead.
-
reward
default <Score_ extends Score<Score_>> UniConstraintBuilder<A,Score_> reward(Score_ constraintWeight)
As defined byreward(Score, ToIntFunction), where the match weight is one (1).- Returns:
- never null
-
reward
<Score_ extends Score<Score_>> UniConstraintBuilder<A,Score_> reward(Score_ constraintWeight, ToIntFunction<A> 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, ToLongFunction)orrewardBigDecimal(Score, Function)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_>> UniConstraintBuilder<A,Score_> rewardLong(Score_ constraintWeight, ToLongFunction<A> matchWeigher)
As defined byreward(Score, ToIntFunction), with a penalty of type long.
-
rewardBigDecimal
<Score_ extends Score<Score_>> UniConstraintBuilder<A,Score_> rewardBigDecimal(Score_ constraintWeight, Function<A,BigDecimal> matchWeigher)
As defined byreward(Score, ToIntFunction), with a penalty of typeBigDecimal.
-
rewardConfigurable
default UniConstraintBuilder<A,?> 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
UniConstraintBuilder<A,?> rewardConfigurable(ToIntFunction<A> 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, ToIntFunction)instead.- Parameters:
matchWeigher- never null, the result of this function (matchWeight) is multiplied by the constraintWeight- Returns:
- never null
-
rewardConfigurableLong
UniConstraintBuilder<A,?> rewardConfigurableLong(ToLongFunction<A> matchWeigher)
As defined byrewardConfigurable(ToIntFunction), with a penalty of type long.If there is no
ConstraintConfiguration, userewardLong(Score, ToLongFunction)instead.
-
rewardConfigurableBigDecimal
UniConstraintBuilder<A,?> rewardConfigurableBigDecimal(Function<A,BigDecimal> matchWeigher)
As defined byrewardConfigurable(ToIntFunction), with a penalty of typeBigDecimal.If there is no
ConstraintConfiguration, userewardBigDecimal(Score, Function)instead.
-
impact
default <Score_ extends Score<Score_>> UniConstraintBuilder<A,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_>> UniConstraintBuilder<A,Score_> impact(Score_ constraintWeight, ToIntFunction<A> 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_>> UniConstraintBuilder<A,Score_> impactLong(Score_ constraintWeight, ToLongFunction<A> matchWeigher)
As defined byimpact(Score, ToIntFunction), with an impact of type long.
-
impactBigDecimal
<Score_ extends Score<Score_>> UniConstraintBuilder<A,Score_> impactBigDecimal(Score_ constraintWeight, Function<A,BigDecimal> matchWeigher)
As defined byimpact(Score, ToIntFunction), with an impact of typeBigDecimal.
-
impactConfigurable
default UniConstraintBuilder<A,?> 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
UniConstraintBuilder<A,?> impactConfigurable(ToIntFunction<A> 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, ToIntFunction)instead.- Returns:
- never null
-
impactConfigurableLong
UniConstraintBuilder<A,?> impactConfigurableLong(ToLongFunction<A> matchWeigher)
As defined byimpactConfigurable(ToIntFunction), with an impact of type long.If there is no
ConstraintConfiguration, useimpactLong(Score, ToLongFunction)instead.
-
impactConfigurableBigDecimal
UniConstraintBuilder<A,?> impactConfigurableBigDecimal(Function<A,BigDecimal> matchWeigher)
As defined byimpactConfigurable(ToIntFunction), with an impact of type BigDecimal.If there is no
ConstraintConfiguration, useimpactBigDecimal(Score, Function)instead.
-
penalize
@Deprecated(forRemoval=true) default Constraint penalize(String constraintName, Score<?> constraintWeight, ToIntFunction<A> matchWeigher)
Deprecated, for removal: This API element is subject to removal in a future version.Preferpenalize(Score, ToIntFunction).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, ToLongFunction)orpenalizeBigDecimal(String, Score, Function)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, ToIntFunction<A> matchWeigher)
Deprecated, for removal: This API element is subject to removal in a future version.Preferpenalize(Score, ToIntFunction).As defined bypenalize(String, Score, ToIntFunction).- Parameters:
constraintPackage- never nullconstraintName- never nullconstraintWeight- never nullmatchWeigher- never null- Returns:
- never null
-
penalizeLong
@Deprecated(forRemoval=true) default Constraint penalizeLong(String constraintName, Score<?> constraintWeight, ToLongFunction<A> 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, ToLongFunction<A> matchWeigher)
Deprecated, for removal: This API element is subject to removal in a future version.As defined bypenalizeLong(String, Score, ToLongFunction).- Parameters:
constraintPackage- never nullconstraintName- never nullconstraintWeight- never nullmatchWeigher- never null- Returns:
- never null
-
penalizeBigDecimal
@Deprecated(forRemoval=true) default Constraint penalizeBigDecimal(String constraintName, Score<?> constraintWeight, Function<A,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, Function<A,BigDecimal> matchWeigher)
Deprecated, for removal: This API element is subject to removal in a future version.As defined bypenalizeBigDecimal(String, Score, Function).- Parameters:
constraintPackage- never nullconstraintName- never nullconstraintWeight- never nullmatchWeigher- never null- Returns:
- never null
-
penalizeConfigurable
@Deprecated(forRemoval=true) default Constraint penalizeConfigurable(String constraintName, ToIntFunction<A> 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, ToLongFunction)orpenalizeConfigurableBigDecimal(String, Function)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, ToIntFunction<A> matchWeigher)
Deprecated, for removal: This API element is subject to removal in a future version.As defined bypenalizeConfigurable(String, ToIntFunction).- Parameters:
constraintPackage- never nullconstraintName- never nullmatchWeigher- never null- Returns:
- never null
-
penalizeConfigurableLong
@Deprecated(forRemoval=true) default Constraint penalizeConfigurableLong(String constraintName, ToLongFunction<A> 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, ToLongFunction<A> matchWeigher)
Deprecated, for removal: This API element is subject to removal in a future version.As defined bypenalizeConfigurableLong(String, ToLongFunction).- Parameters:
constraintPackage- never nullconstraintName- never nullmatchWeigher- never null- Returns:
- never null
-
penalizeConfigurableBigDecimal
@Deprecated(forRemoval=true) default Constraint penalizeConfigurableBigDecimal(String constraintName, Function<A,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, Function<A,BigDecimal> matchWeigher)
Deprecated, for removal: This API element is subject to removal in a future version.As defined bypenalizeConfigurableBigDecimal(String, Function).- Parameters:
constraintPackage- never nullconstraintName- never nullmatchWeigher- never null- Returns:
- never null
-
reward
@Deprecated(forRemoval=true) default Constraint reward(String constraintName, Score<?> constraintWeight, ToIntFunction<A> matchWeigher)
Deprecated, for removal: This API element is subject to removal in a future version.Preferreward(Score, ToIntFunction).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, ToLongFunction)orrewardBigDecimal(String, Score, Function)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, ToIntFunction<A> matchWeigher)
Deprecated, for removal: This API element is subject to removal in a future version.Preferreward(Score, ToIntFunction).As defined byreward(String, Score, ToIntFunction).- Parameters:
constraintPackage- never nullconstraintName- never nullconstraintWeight- never nullmatchWeigher- never null- Returns:
- never null
-
rewardLong
@Deprecated(forRemoval=true) default Constraint rewardLong(String constraintName, Score<?> constraintWeight, ToLongFunction<A> 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, ToLongFunction<A> matchWeigher)
Deprecated, for removal: This API element is subject to removal in a future version.As defined byrewardLong(String, Score, ToLongFunction).- Parameters:
constraintPackage- never nullconstraintName- never nullconstraintWeight- never nullmatchWeigher- never null- Returns:
- never null
-
rewardBigDecimal
@Deprecated(forRemoval=true) default Constraint rewardBigDecimal(String constraintName, Score<?> constraintWeight, Function<A,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, Function<A,BigDecimal> matchWeigher)
Deprecated, for removal: This API element is subject to removal in a future version.As defined byrewardBigDecimal(String, Score, Function).- Parameters:
constraintPackage- never nullconstraintName- never nullconstraintWeight- never nullmatchWeigher- never null- Returns:
- never null
-
rewardConfigurable
@Deprecated(forRemoval=true) default Constraint rewardConfigurable(String constraintName, ToIntFunction<A> 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, ToLongFunction)orrewardConfigurableBigDecimal(String, Function)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(forRemoval=true) default Constraint rewardConfigurable(String constraintPackage, String constraintName, ToIntFunction<A> matchWeigher)
Deprecated, for removal: This API element is subject to removal in a future version.As defined byrewardConfigurable(String, ToIntFunction).- Parameters:
constraintPackage- never nullconstraintName- never nullmatchWeigher- never null- Returns:
- never null
-
rewardConfigurableLong
@Deprecated(forRemoval=true) default Constraint rewardConfigurableLong(String constraintName, ToLongFunction<A> 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, ToLongFunction<A> matchWeigher)
Deprecated, for removal: This API element is subject to removal in a future version.As defined byrewardConfigurableLong(String, ToLongFunction).- Parameters:
constraintPackage- never nullconstraintName- never nullmatchWeigher- never null- Returns:
- never null
-
rewardConfigurableBigDecimal
@Deprecated(forRemoval=true) default Constraint rewardConfigurableBigDecimal(String constraintName, Function<A,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, Function<A,BigDecimal> matchWeigher)
Deprecated, for removal: This API element is subject to removal in a future version.As defined byrewardConfigurableBigDecimal(String, Function).- Parameters:
constraintPackage- never nullconstraintName- never nullmatchWeigher- never null- Returns:
- never null
-
impact
@Deprecated(forRemoval=true) default Constraint impact(String constraintName, Score<?> constraintWeight, ToIntFunction<A> matchWeigher)
Deprecated, for removal: This API element is subject to removal in a future version.Preferimpact(Score, ToIntFunction).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, ToLongFunction)orimpactBigDecimal(String, Score, Function)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, ToIntFunction<A> matchWeigher)
Deprecated, for removal: This API element is subject to removal in a future version.Preferimpact(Score, ToIntFunction).As defined byimpact(String, Score, ToIntFunction).- Parameters:
constraintPackage- never nullconstraintName- never nullconstraintWeight- never nullmatchWeigher- never null- Returns:
- never null
-
impactLong
@Deprecated(forRemoval=true) default Constraint impactLong(String constraintName, Score<?> constraintWeight, ToLongFunction<A> 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, ToLongFunction<A> matchWeigher)
Deprecated, for removal: This API element is subject to removal in a future version.As defined byimpactLong(String, Score, ToLongFunction).- Parameters:
constraintPackage- never nullconstraintName- never nullconstraintWeight- never nullmatchWeigher- never null- Returns:
- never null
-
impactBigDecimal
@Deprecated(forRemoval=true) default Constraint impactBigDecimal(String constraintName, Score<?> constraintWeight, Function<A,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, Function<A,BigDecimal> matchWeigher)
Deprecated, for removal: This API element is subject to removal in a future version.As defined byimpactBigDecimal(String, Score, Function).- Parameters:
constraintPackage- never nullconstraintName- never nullconstraintWeight- never nullmatchWeigher- never null- Returns:
- never null
-
impactConfigurable
@Deprecated(forRemoval=true) default Constraint impactConfigurable(String constraintName, ToIntFunction<A> 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.For non-int
Scoretypes useimpactConfigurableLong(String, ToLongFunction)orimpactConfigurableBigDecimal(String, Function)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, ToIntFunction<A> matchWeigher)
Deprecated, for removal: This API element is subject to removal in a future version.As defined byimpactConfigurable(String, ToIntFunction).- Parameters:
constraintPackage- never nullconstraintName- never nullmatchWeigher- never null- Returns:
- never null
-
impactConfigurableLong
@Deprecated(forRemoval=true) default Constraint impactConfigurableLong(String constraintName, ToLongFunction<A> 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, ToLongFunction<A> matchWeigher)
Deprecated, for removal: This API element is subject to removal in a future version.As defined byimpactConfigurableLong(String, ToLongFunction).- Parameters:
constraintPackage- never nullconstraintName- never nullmatchWeigher- never null- Returns:
- never null
-
impactConfigurableBigDecimal
@Deprecated(forRemoval=true) default Constraint impactConfigurableBigDecimal(String constraintName, Function<A,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, Function<A,BigDecimal> matchWeigher)
Deprecated, for removal: This API element is subject to removal in a future version.As defined byimpactConfigurableBigDecimal(String, Function).- Parameters:
constraintPackage- never nullconstraintName- never nullmatchWeigher- never null- Returns:
- never null
-
-