Interface UniConstraintStream<A>
- Type Parameters:
A
- the type of the first and only fact in the tuple.
- All Superinterfaces:
ConstraintStream
ConstraintStream
that matches one fact.- See Also:
-
Method Summary
Modifier and TypeMethodDescriptiondistinct()
Transforms the stream in such a way that all the tuples going through it are distinct.Exhaustively test each fact against thePredicate
and 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
.<GroupKey_>
UniConstraintStream<GroupKey_>Convert theUniConstraintStream
to 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 theUniConstraintStream
to 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 theUniConstraintStream
to 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 theUniConstraintStream
to aQuadConstraintStream
, consisting of unique tuples with four facts.<GroupKeyA_,
GroupKeyB_>
BiConstraintStream<GroupKeyA_,GroupKeyB_> Convert theUniConstraintStream
to aBiConstraintStream
, consisting of unique tuples with two facts.<GroupKeyA_,
GroupKeyB_, GroupKeyC_>
TriConstraintStream<GroupKeyA_,GroupKeyB_, GroupKeyC_> groupBy
(Function<A, GroupKeyA_> groupKeyAMapping, Function<A, GroupKeyB_> groupKeyBMapping, Function<A, GroupKeyC_> groupKeyCMapping) Convert theUniConstraintStream
to aTriConstraintStream
, consisting of unique tuples with three facts.<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 theUniConstraintStream
to aQuadConstraintStream
, consisting of unique tuples with four 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_, 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)
.<ResultContainer_,
Result_>
UniConstraintStream<Result_>groupBy
(UniConstraintCollector<A, ResultContainer_, Result_> collector) Convert theUniConstraintStream
to 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 theUniConstraintStream
to aBiConstraintStream
, containing only a single tuple, the result of applying twoUniConstraintCollector
s.<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 theUniConstraintStream
to aTriConstraintStream
, containing only a single tuple, the result of applying threeUniConstraintCollector
s.<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 theUniConstraintStream
to aQuadConstraintStream
, containing only a single tuple, the result of applying fourUniConstraintCollector
s.default <B> UniConstraintStream<A>
Create a newUniConstraintStream
for every A where B exists for which theBiJoiner
is true (for the properties it extracts from both facts).<B> UniConstraintStream<A>
As defined byifExists(Class, BiJoiner)
.default <B> UniConstraintStream<A>
As defined byifExists(Class, BiJoiner)
.default <B> UniConstraintStream<A>
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 newUniConstraintStream
for every A where B exists for which theBiJoiner
is 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>
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 newUniConstraintStream
for every A, if another A exists that does notObject.equals(Object)
the first.default UniConstraintStream<A>
Create a newUniConstraintStream
for every A, if another A exists that does notObject.equals(Object)
the first, and for which theBiJoiner
is true (for the properties it extracts from both facts).default UniConstraintStream<A>
As defined byifExistsOther(Class, BiJoiner)
.default UniConstraintStream<A>
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 newUniConstraintStream
for every A, if another A exists that does notObject.equals(Object)
the first.default UniConstraintStream<A>
Create a newUniConstraintStream
for every A, if another A exists that does notObject.equals(Object)
the first, and for which theBiJoiner
is true (for the properties it extracts from both facts).default UniConstraintStream<A>
As defined byifExistsOtherIncludingNullVars(Class, BiJoiner)
.default UniConstraintStream<A>
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 newUniConstraintStream
for every A where B does not exist for which theBiJoiner
is 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>
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 newUniConstraintStream
for every A where B does not exist for which theBiJoiner
is 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>
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 newUniConstraintStream
for every A, if no other A exists that does notObject.equals(Object)
the first.default UniConstraintStream<A>
Create a newUniConstraintStream
for every A, if no other A exists that does notObject.equals(Object)
the first, and for which theBiJoiner
is true (for the properties it extracts from both facts).default UniConstraintStream<A>
As defined byifNotExistsOther(Class, BiJoiner)
.default UniConstraintStream<A>
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 newUniConstraintStream
for every A, if no other A exists that does notObject.equals(Object)
the first.default UniConstraintStream<A>
Create a newUniConstraintStream
for every A, if no other A exists that does notObject.equals(Object)
the first, and for which theBiJoiner
is true (for the properties it extracts from both facts).default UniConstraintStream<A>
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 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.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)
.default <Score_ extends Score<Score_>>
UniConstraintBuilder<A,Score_> impact
(Score_ constraintWeight) Positively or negatively impacts theScore
by 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 theScore
by constraintWeight multiplied by matchWeight for each match and returns a builder to apply optional constraint properties.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.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.<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,
?> Positively impacts theScore
by theConstraintWeight
for each match, and returns a builder to apply optional constraint properties.default Constraint
impactConfigurable
(String constraintPackage, String constraintName, ToIntFunction<A> matchWeigher) Deprecated, for removal: This API element is subject to removal in a future version.default Constraint
impactConfigurable
(String constraintName, ToIntFunction<A> matchWeigher) Deprecated, for removal: This API element is subject to removal in a future version.impactConfigurable
(ToIntFunction<A> matchWeigher) Positively impacts theScore
by theConstraintWeight
multiplied by match weight for each match, and returns a builder to apply optional constraint properties.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.default Constraint
impactConfigurableBigDecimal
(String constraintName, Function<A, BigDecimal> matchWeigher) Deprecated, for removal: This API element is subject to removal in a future version.impactConfigurableBigDecimal
(Function<A, BigDecimal> matchWeigher) As defined byimpactConfigurable(ToIntFunction)
, with an impact of type BigDecimal.default Constraint
impactConfigurableLong
(String constraintPackage, String constraintName, ToLongFunction<A> matchWeigher) Deprecated, for removal: This API element is subject to removal in a future version.default Constraint
impactConfigurableLong
(String constraintName, ToLongFunction<A> matchWeigher) Deprecated, for removal: This API element is subject to removal in a future version.impactConfigurableLong
(ToLongFunction<A> matchWeigher) As defined byimpactConfigurable(ToIntFunction)
, with an impact of type long.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.default Constraint
impactLong
(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> Create a newBiConstraintStream
for every combination of A and B.default <B> BiConstraintStream<A,
B> Create a newBiConstraintStream
for every combination of A and B for which theBiJoiner
is true (for the properties it extracts from both facts).<B> BiConstraintStream<A,
B> As defined byjoin(Class, BiJoiner)
.default <B> BiConstraintStream<A,
B> As defined byjoin(Class, BiJoiner)
.default <B> BiConstraintStream<A,
B> 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)
.default <B> BiConstraintStream<A,
B> join
(UniConstraintStream<B> otherStream) Create a newBiConstraintStream
for every combination of A and B.default <B> BiConstraintStream<A,
B> join
(UniConstraintStream<B> otherStream, BiJoiner<A, B> joiner) Create a newBiConstraintStream
for every combination of A and B for which theBiJoiner
is 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> 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)
.<ResultA_> UniConstraintStream<ResultA_>
Transforms the stream in such a way that tuples are remapped using the given function.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)
.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)
.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 negativeScore
impact, subtracting the constraintWeight multiplied by the match weight, and returns a builder to apply optional constraint properties.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.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.<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,
?> Negatively impacts theScore
, subtracting theConstraintWeight
for each match, and returns a builder to apply optional constraint properties.default Constraint
penalizeConfigurable
(String constraintPackage, String constraintName, ToIntFunction<A> matchWeigher) Deprecated, for removal: This API element is subject to removal in a future version.default Constraint
penalizeConfigurable
(String constraintName, ToIntFunction<A> matchWeigher) Deprecated, for removal: This API element is subject to removal in a future version.penalizeConfigurable
(ToIntFunction<A> matchWeigher) Negatively impacts theScore
, subtracting theConstraintWeight
multiplied by match weight for each match, and returns a builder to apply optional constraint properties.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.default Constraint
penalizeConfigurableBigDecimal
(String constraintName, Function<A, BigDecimal> matchWeigher) Deprecated, for removal: This API element is subject to removal in a future version.penalizeConfigurableBigDecimal
(Function<A, BigDecimal> matchWeigher) As defined bypenalizeConfigurable(ToIntFunction)
, with a penalty of typeBigDecimal
.default Constraint
penalizeConfigurableLong
(String constraintPackage, String constraintName, ToLongFunction<A> matchWeigher) Deprecated, for removal: This API element is subject to removal in a future version.default Constraint
penalizeConfigurableLong
(String constraintName, ToLongFunction<A> matchWeigher) Deprecated, for removal: This API element is subject to removal in a future version.penalizeConfigurableLong
(ToLongFunction<A> matchWeigher) As defined bypenalizeConfigurable(ToIntFunction)
, with a penalty of type long.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.default Constraint
penalizeLong
(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 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)
.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)
.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 positiveScore
impact, adding the constraintWeight multiplied by the match weight, and returns a builder to apply optional constraint properties.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.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.<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,
?> Positively impacts theScore
, adding theConstraintWeight
for each match, and returns a builder to apply optional constraint properties.default Constraint
rewardConfigurable
(String constraintPackage, String constraintName, ToIntFunction<A> matchWeigher) Deprecated, for removal: This API element is subject to removal in a future version.default Constraint
rewardConfigurable
(String constraintName, ToIntFunction<A> matchWeigher) Deprecated, for removal: This API element is subject to removal in a future version.rewardConfigurable
(ToIntFunction<A> matchWeigher) Positively impacts theScore
, adding theConstraintWeight
multiplied by match weight for each match, and returns a builder to apply optional constraint properties.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.default Constraint
rewardConfigurableBigDecimal
(String constraintName, Function<A, BigDecimal> matchWeigher) Deprecated, for removal: This API element is subject to removal in a future version.rewardConfigurableBigDecimal
(Function<A, BigDecimal> matchWeigher) As defined byrewardConfigurable(ToIntFunction)
, with a penalty of typeBigDecimal
.default Constraint
rewardConfigurableLong
(String constraintPackage, String constraintName, ToLongFunction<A> matchWeigher) Deprecated, for removal: This API element is subject to removal in a future version.default Constraint
rewardConfigurableLong
(String constraintName, ToLongFunction<A> matchWeigher) Deprecated, for removal: This API element is subject to removal in a future version.rewardConfigurableLong
(ToLongFunction<A> matchWeigher) As defined byrewardConfigurable(ToIntFunction)
, with a penalty of type long.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.default Constraint
rewardLong
(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 org.optaplanner.core.api.score.stream.ConstraintStream
getConstraintFactory, impact, impact, penalize, penalize, penalizeConfigurable, penalizeConfigurable, reward, reward, rewardConfigurable, rewardConfigurable
-
Method Details
-
filter
Exhaustively test each fact against thePredicate
and match ifPredicate.test(Object)
returns true.- Parameters:
predicate
- never null- Returns:
- never null
-
join
Create a newBiConstraintStream
for every combination of A and B.Important:
Filtering
this 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
Create a newBiConstraintStream
for every combination of A and B for which theBiJoiner
is true (for the properties it extracts from both facts).Important: This is faster and more scalable than a
join
followed 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
BiJoiner
is 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
joiners
are 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
joiners
are 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
joiners
are true
-
join
As defined byjoin(UniConstraintStream, BiJoiner)
. If multipleBiJoiner
s 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
SafeVarargs
annotation because it's an interface method. Therefore, there are overloaded methods with up to 4BiJoiner
parameters.- 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
joiners
are true
-
join
Create a newBiConstraintStream
for every combination of A and B.Important:
Filtering
this 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
join
followed 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
Create a newBiConstraintStream
for every combination of A and B for which theBiJoiner
is true (for the properties it extracts from both facts).Important: This is faster and more scalable than a
join
followed 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
BiJoiner
parameters.- 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
BiJoiner
is 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
joiners
are 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
joiners
are 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
joiners
are true
-
join
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
SafeVarargs
annotation because it's an interface method. Therefore, there are overloaded methods with up to 4BiJoiner
parameters.- 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
joiners
are true
-
ifExists
Create a newUniConstraintStream
for every A where B exists for which theBiJoiner
is true (for the properties it extracts from both facts).This method has overloaded methods with multiple
BiJoiner
parameters.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
BiJoiner
is 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
BiJoiner
s 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
BiJoiner
s 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
BiJoiner
s are true
-
ifExists
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
SafeVarargs
annotation because it's an interface method. Therefore, there are overloaded methods with up to 4BiJoiner
parameters.- 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
BiJoiner
s are true
-
ifExistsIncludingNullVars
default <B> UniConstraintStream<A> ifExistsIncludingNullVars(Class<B> otherClass, BiJoiner<A, B> joiner) Create a newUniConstraintStream
for every A where B exists for which theBiJoiner
is 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
BiJoiner
parameters.- 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
BiJoiner
is 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
BiJoiner
s 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
BiJoiner
s 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
BiJoiner
s are true
-
ifExistsIncludingNullVars
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
SafeVarargs
annotation because it's an interface method. Therefore, there are overloaded methods with up to 4BiJoiner
parameters.- 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
BiJoiner
s are true
-
ifExistsOther
Create a newUniConstraintStream
for 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
Create a newUniConstraintStream
for every A, if another A exists that does notObject.equals(Object)
the first, and for which theBiJoiner
is true (for the properties it extracts from both facts).This method has overloaded methods with multiple
BiJoiner
parameters.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
BiJoiner
is 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
BiJoiner
s 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
BiJoiner
s 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
BiJoiner
s are true
-
ifExistsOther
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
SafeVarargs
annotation because it's an interface method. Therefore, there are overloaded methods with up to 4BiJoiner
parameters.- Parameters:
otherClass
- never nulljoiners
- never null- Returns:
- never null, a stream that matches every A where a different A exists for which all the
BiJoiner
s are true
-
ifExistsOtherIncludingNullVars
Create a newUniConstraintStream
for 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 newUniConstraintStream
for every A, if another A exists that does notObject.equals(Object)
the first, and for which theBiJoiner
is 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
BiJoiner
parameters.- Parameters:
otherClass
- never nulljoiner
- never null- Returns:
- never null, a stream that matches every A where a different A exists for which the
BiJoiner
is 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
BiJoiner
s 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
BiJoiner
s 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
BiJoiner
s are true
-
ifExistsOtherIncludingNullVars
default UniConstraintStream<A> ifExistsOtherIncludingNullVars(Class<A> otherClass, BiJoiner<A, A>... joiners) As defined byifExistsOtherIncludingNullVars(Class, BiJoiner)
. If multipleBiJoiner
s 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
SafeVarargs
annotation because it's an interface method. Therefore, there are overloaded methods with up to 4BiJoiner
parameters.- Parameters:
otherClass
- never nulljoiners
- never null- Returns:
- never null, a stream that matches every A where a different A exists for which all the
BiJoiner
s are true
-
ifNotExists
Create a newUniConstraintStream
for every A where B does not exist for which theBiJoiner
is true (for the properties it extracts from both facts).This method has overloaded methods with multiple
BiJoiner
parameters.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
BiJoiner
is 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
BiJoiner
s 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
BiJoiner
s 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
BiJoiner
s are true
-
ifNotExists
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
SafeVarargs
annotation because it's an interface method. Therefore, there are overloaded methods with up to 4BiJoiner
parameters.- 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
BiJoiner
s are true
-
ifNotExistsIncludingNullVars
default <B> UniConstraintStream<A> ifNotExistsIncludingNullVars(Class<B> otherClass, BiJoiner<A, B> joiner) Create a newUniConstraintStream
for every A where B does not exist for which theBiJoiner
is 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
BiJoiner
parameters.- 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
BiJoiner
is 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
BiJoiner
s 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
BiJoiner
s 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
BiJoiner
s 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
SafeVarargs
annotation because it's an interface method. Therefore, there are overloaded methods with up to 4BiJoiner
parameters.- 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
BiJoiner
s are true
-
ifNotExistsOther
Create a newUniConstraintStream
for 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
Create a newUniConstraintStream
for every A, if no other A exists that does notObject.equals(Object)
the first, and for which theBiJoiner
is true (for the properties it extracts from both facts).This method has overloaded methods with multiple
BiJoiner
parameters.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
BiJoiner
is 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
BiJoiner
s 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
BiJoiner
s 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
BiJoiner
s are true
-
ifNotExistsOther
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
SafeVarargs
annotation because it's an interface method. Therefore, there are overloaded methods with up to 4BiJoiner
parameters.- 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
BiJoiner
s are true
-
ifNotExistsOtherIncludingNullVars
Create a newUniConstraintStream
for 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 newUniConstraintStream
for every A, if no other A exists that does notObject.equals(Object)
the first, and for which theBiJoiner
is 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
BiJoiner
parameters.- 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
BiJoiner
is 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
BiJoiner
s 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
BiJoiner
s 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
BiJoiner
s are true
-
ifNotExistsOtherIncludingNullVars
default UniConstraintStream<A> ifNotExistsOtherIncludingNullVars(Class<A> otherClass, BiJoiner<A, A>... joiners) As defined byifNotExistsOtherIncludingNullVars(Class, BiJoiner)
. If multipleBiJoiner
s 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
SafeVarargs
annotation because it's an interface method. Therefore, there are overloaded methods with up to 4BiJoiner
parameters.- 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
BiJoiner
s are true
-
groupBy
<ResultContainer_,Result_> UniConstraintStream<Result_> groupBy(UniConstraintCollector<A, ResultContainer_, Result_> collector) Convert theUniConstraintStream
to 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 SeeConstraintCollectors
for common operations, such ascount()
,sum()
and others.- Returns:
- never null
-
groupBy
<ResultContainerA_,ResultA_, BiConstraintStream<ResultA_,ResultContainerB_, ResultB_> ResultB_> groupBy(UniConstraintCollector<A, ResultContainerA_, ResultA_> collectorA, UniConstraintCollector<A, ResultContainerB_, ResultB_> collectorB) Convert theUniConstraintStream
to aBiConstraintStream
, containing only a single tuple, the result of applying twoUniConstraintCollector
s.- 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 SeeConstraintCollectors
for common operations, such ascount()
,sum()
and others.collectorB
- never null, the collector to perform the second grouping operation with SeeConstraintCollectors
for common operations, such ascount()
,sum()
and others.- Returns:
- never null
-
groupBy
<ResultContainerA_,ResultA_, TriConstraintStream<ResultA_,ResultContainerB_, ResultB_, ResultContainerC_, ResultC_> ResultB_, groupByResultC_> (UniConstraintCollector<A, ResultContainerA_, ResultA_> collectorA, UniConstraintCollector<A, ResultContainerB_, ResultB_> collectorB, UniConstraintCollector<A, ResultContainerC_, ResultC_> collectorC) Convert theUniConstraintStream
to aTriConstraintStream
, containing only a single tuple, the result of applying threeUniConstraintCollector
s.- 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 SeeConstraintCollectors
for common operations, such ascount()
,sum()
and others.collectorB
- never null, the collector to perform the second grouping operation with SeeConstraintCollectors
for common operations, such ascount()
,sum()
and others.collectorC
- never null, the collector to perform the third grouping operation with SeeConstraintCollectors
for common operations, such ascount()
,sum()
and others.- Returns:
- never null
-
groupBy
<ResultContainerA_,ResultA_, QuadConstraintStream<ResultA_,ResultContainerB_, ResultB_, ResultContainerC_, ResultC_, ResultContainerD_, ResultD_> ResultB_, groupByResultC_, ResultD_> (UniConstraintCollector<A, ResultContainerA_, ResultA_> collectorA, UniConstraintCollector<A, ResultContainerB_, ResultB_> collectorB, UniConstraintCollector<A, ResultContainerC_, ResultC_> collectorC, UniConstraintCollector<A, ResultContainerD_, ResultD_> collectorD) Convert theUniConstraintStream
to aQuadConstraintStream
, containing only a single tuple, the result of applying fourUniConstraintCollector
s.- 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 SeeConstraintCollectors
for common operations, such ascount()
,sum()
and others.collectorB
- never null, the collector to perform the second grouping operation with SeeConstraintCollectors
for common operations, such ascount()
,sum()
and others.collectorC
- never null, the collector to perform the third grouping operation with SeeConstraintCollectors
for common operations, such ascount()
,sum()
and others.collectorD
- never null, the collector to perform the fourth grouping operation with SeeConstraintCollectors
for common operations, such ascount()
,sum()
and others.- Returns:
- never null
-
groupBy
Convert theUniConstraintStream
to 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_, BiConstraintStream<GroupKey_,Result_> Result_> groupBy(Function<A, GroupKey_> groupKeyMapping, UniConstraintCollector<A, ResultContainer_, Result_> collector) Convert theUniConstraintStream
to 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
UniConstraintCollector
applied 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 SeeConstraintCollectors
for common operations, such ascount()
,sum()
and others.- Returns:
- never null
-
groupBy
<GroupKey_,ResultContainerB_, TriConstraintStream<GroupKey_,ResultB_, ResultContainerC_, ResultC_> ResultB_, groupByResultC_> (Function<A, GroupKey_> groupKeyMapping, UniConstraintCollector<A, ResultContainerB_, ResultB_> collectorB, UniConstraintCollector<A, ResultContainerC_, ResultC_> collectorC) Convert theUniConstraintStream
to 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
UniConstraintCollector
applied 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 SeeConstraintCollectors
for common operations, such ascount()
,sum()
and others.collectorC
- never null, the collector to perform the second grouping operation with SeeConstraintCollectors
for common operations, such ascount()
,sum()
and others.- Returns:
- never null
-
groupBy
<GroupKey_,ResultContainerB_, QuadConstraintStream<GroupKey_,ResultB_, ResultContainerC_, ResultC_, ResultContainerD_, ResultD_> ResultB_, groupByResultC_, ResultD_> (Function<A, GroupKey_> groupKeyMapping, UniConstraintCollector<A, ResultContainerB_, ResultB_> collectorB, UniConstraintCollector<A, ResultContainerC_, ResultC_> collectorC, UniConstraintCollector<A, ResultContainerD_, ResultD_> collectorD) Convert theUniConstraintStream
to 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
UniConstraintCollector
applied 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 SeeConstraintCollectors
for common operations, such ascount()
,sum()
and others.collectorC
- never null, the collector to perform the second grouping operation with SeeConstraintCollectors
for common operations, such ascount()
,sum()
and others.collectorD
- never null, the collector to perform the third grouping operation with SeeConstraintCollectors
for 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 theUniConstraintStream
to 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_, TriConstraintStream<GroupKeyA_,ResultContainer_, Result_> GroupKeyB_, groupByResult_> (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 originalUniConstraintStream
that 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 SeeConstraintCollectors
for common operations, such ascount()
,sum()
and others.- Returns:
- never null
-
groupBy
<GroupKeyA_,GroupKeyB_, QuadConstraintStream<GroupKeyA_,ResultContainerC_, ResultC_, ResultContainerD_, ResultD_> GroupKeyB_, groupByResultC_, ResultD_> (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 originalUniConstraintStream
that belong to the group. The fourth fact is the result of applying the secondUniConstraintCollector.finisher()
on all the tuples of the originalUniConstraintStream
that 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 SeeConstraintCollectors
for common operations, such ascount()
,sum()
and others.collectorD
- never null, the collector to perform the second grouping operation with SeeConstraintCollectors
for common operations, such ascount()
,sum()
and others.- Returns:
- never null
-
groupBy
<GroupKeyA_,GroupKeyB_, TriConstraintStream<GroupKeyA_,GroupKeyC_> GroupKeyB_, groupByGroupKeyC_> (Function<A, GroupKeyA_> groupKeyAMapping, Function<A, GroupKeyB_> groupKeyBMapping, Function<A, GroupKeyC_> groupKeyCMapping) Convert theUniConstraintStream
to 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_, QuadConstraintStream<GroupKeyA_,GroupKeyC_, ResultContainerD_, ResultD_> GroupKeyB_, groupByGroupKeyC_, ResultD_> (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 originalUniConstraintStream
that 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 SeeConstraintCollectors
for common operations, such ascount()
,sum()
and others.- Returns:
- never null
-
groupBy
<GroupKeyA_,GroupKeyB_, QuadConstraintStream<GroupKeyA_,GroupKeyC_, GroupKeyD_> GroupKeyB_, groupByGroupKeyC_, GroupKeyD_> (Function<A, GroupKeyA_> groupKeyAMapping, Function<A, GroupKeyB_> groupKeyBMapping, Function<A, GroupKeyC_> groupKeyCMapping, Function<A, GroupKeyD_> groupKeyDMapping) Convert theUniConstraintStream
to 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 ofInteger
s *[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
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 likewiseequal
and 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
Person
s[Ann(age = 20), Beth(age = 25), Cathy(age = 30)]
, callingmap(Person::getAge)
on such stream will produce a stream ofInteger
s[20, 25, 30]
,Example with a non-bijective mapping function: assuming a constraint stream of tuples of
Person
s[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 ofInteger
s[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
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
Person
s[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 negativeScore
impact, subtracting the constraintWeight multiplied by the match weight, and returns a builder to apply optional constraint properties.For non-int
Score
types 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
Negatively impacts theScore
, subtracting theConstraintWeight
for each match, and returns a builder to apply optional constraint properties.The constraintWeight comes from an
ConstraintWeight
annotated member on theConstraintConfiguration
, so end users can change the constraint weights dynamically. This constraint may be deactivated if theConstraintWeight
is zero. If there is noConstraintConfiguration
, usepenalize(Score)
instead.- Returns:
- never null
-
penalizeConfigurable
Negatively impacts theScore
, subtracting theConstraintWeight
multiplied by match weight for each match, and returns a builder to apply optional constraint properties.The constraintWeight comes from an
ConstraintWeight
annotated member on theConstraintConfiguration
, so end users can change the constraint weights dynamically. This constraint may be deactivated if theConstraintWeight
is 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
As defined bypenalizeConfigurable(ToIntFunction)
, with a penalty of type long.If there is no
ConstraintConfiguration
, usepenalizeLong(Score, ToLongFunction)
instead. -
penalizeConfigurableBigDecimal
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 positiveScore
impact, adding the constraintWeight multiplied by the match weight, and returns a builder to apply optional constraint properties.For non-int
Score
types 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
Positively impacts theScore
, adding theConstraintWeight
for each match, and returns a builder to apply optional constraint properties.The constraintWeight comes from an
ConstraintWeight
annotated member on theConstraintConfiguration
, so end users can change the constraint weights dynamically. This constraint may be deactivated if theConstraintWeight
is zero. If there is noConstraintConfiguration
, usereward(Score)
instead.- Returns:
- never null
-
rewardConfigurable
Positively impacts theScore
, adding theConstraintWeight
multiplied by match weight for each match, and returns a builder to apply optional constraint properties.The constraintWeight comes from an
ConstraintWeight
annotated member on theConstraintConfiguration
, so end users can change the constraint weights dynamically. This constraint may be deactivated if theConstraintWeight
is 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
As defined byrewardConfigurable(ToIntFunction)
, with a penalty of type long.If there is no
ConstraintConfiguration
, userewardLong(Score, ToLongFunction)
instead. -
rewardConfigurableBigDecimal
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 theScore
by 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 theScore
by 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
Positively impacts theScore
by theConstraintWeight
for each match, and returns a builder to apply optional constraint properties.The constraintWeight comes from an
ConstraintWeight
annotated member on theConstraintConfiguration
, so end users can change the constraint weights dynamically. This constraint may be deactivated if theConstraintWeight
is zero. If there is noConstraintConfiguration
, useimpact(Score)
instead.- Returns:
- never null
-
impactConfigurable
Positively impacts theScore
by theConstraintWeight
multiplied by match weight for each match, and returns a builder to apply optional constraint properties.The constraintWeight comes from an
ConstraintWeight
annotated member on theConstraintConfiguration
, so end users can change the constraint weights dynamically. This constraint may be deactivated if theConstraintWeight
is zero. If there is noConstraintConfiguration
, useimpact(Score, ToIntFunction)
instead.- Returns:
- never null
-
impactConfigurableLong
As defined byimpactConfigurable(ToIntFunction)
, with an impact of type long.If there is no
ConstraintConfiguration
, useimpactLong(Score, ToLongFunction)
instead. -
impactConfigurableBigDecimal
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
Score
types usepenalizeLong(String, Score, ToLongFunction)
orpenalizeBigDecimal(String, Score, Function)
instead.- Parameters:
constraintName
- never null, shows up inConstraintMatchTotal
during 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 inConstraintMatchTotal
during 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 inConstraintMatchTotal
during 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 theConstraintWeight
multiplied by the match weight. Otherwise as defined byConstraintStream.penalizeConfigurable(String)
.For non-int
Score
types usepenalizeConfigurableLong(String, ToLongFunction)
orpenalizeConfigurableBigDecimal(String, Function)
instead.- Parameters:
constraintName
- never null, shows up inConstraintMatchTotal
during 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 theConstraintWeight
multiplied by the match weight. Otherwise as defined byConstraintStream.penalizeConfigurable(String)
.- Parameters:
constraintName
- never null, shows up inConstraintMatchTotal
during 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 theConstraintWeight
multiplied by the match weight. Otherwise as defined byConstraintStream.penalizeConfigurable(String)
.- Parameters:
constraintName
- never null, shows up inConstraintMatchTotal
during 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
Score
types userewardLong(String, Score, ToLongFunction)
orrewardBigDecimal(String, Score, Function)
instead.- Parameters:
constraintName
- never null, shows up inConstraintMatchTotal
during 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 inConstraintMatchTotal
during 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 inConstraintMatchTotal
during 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 theConstraintWeight
multiplied by the match weight. Otherwise as defined byConstraintStream.rewardConfigurable(String)
.For non-int
Score
types userewardConfigurableLong(String, ToLongFunction)
orrewardConfigurableBigDecimal(String, Function)
instead.- Parameters:
constraintName
- never null, shows up inConstraintMatchTotal
during 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 theConstraintWeight
multiplied by the match weight. Otherwise as defined byConstraintStream.rewardConfigurable(String)
.- Parameters:
constraintName
- never null, shows up inConstraintMatchTotal
during 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 theConstraintWeight
multiplied by the match weight. Otherwise as defined byConstraintStream.rewardConfigurable(String)
.- Parameters:
constraintName
- never null, shows up inConstraintMatchTotal
during 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 theScore
by 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
Score
types useimpactLong(String, Score, ToLongFunction)
orimpactBigDecimal(String, Score, Function)
instead.- Parameters:
constraintName
- never null, shows up inConstraintMatchTotal
during 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 theScore
by 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 inConstraintMatchTotal
during 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 theScore
by 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 inConstraintMatchTotal
during 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 theScore
by theConstraintWeight
multiplied by the match weight.Use
penalizeConfigurable(...)
orrewardConfigurable(...)
instead, unless this constraint can both have positive and negative weights.The constraintWeight comes from an
ConstraintWeight
annotated member on theConstraintConfiguration
, so end users can change the constraint weights dynamically. This constraint may be deactivated if theConstraintWeight
is zero. If there is noConstraintConfiguration
, useConstraintStream.impact(String, Score)
instead.For non-int
Score
types useimpactConfigurableLong(String, ToLongFunction)
orimpactConfigurableBigDecimal(String, Function)
instead.The
Constraint.getConstraintPackage()
defaults toConstraintConfiguration.constraintPackage()
.- Parameters:
constraintName
- never null, shows up inConstraintMatchTotal
during 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 theScore
by theConstraintWeight
multiplied by the match weight.Use
penalizeConfigurableLong(...)
orrewardConfigurableLong(...)
instead, unless this constraint can both have positive and negative weights.The constraintWeight comes from an
ConstraintWeight
annotated member on theConstraintConfiguration
, so end users can change the constraint weights dynamically. This constraint may be deactivated if theConstraintWeight
is zero. If there is noConstraintConfiguration
, useConstraintStream.impact(String, Score)
instead.The
Constraint.getConstraintPackage()
defaults toConstraintConfiguration.constraintPackage()
.- Parameters:
constraintName
- never null, shows up inConstraintMatchTotal
during 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 theScore
by theConstraintWeight
multiplied by the match weight.Use
penalizeConfigurableBigDecimal(...)
orrewardConfigurableBigDecimal(...)
instead, unless this constraint can both have positive and negative weights.The constraintWeight comes from an
ConstraintWeight
annotated member on theConstraintConfiguration
, so end users can change the constraint weights dynamically. This constraint may be deactivated if theConstraintWeight
is zero. If there is noConstraintConfiguration
, useConstraintStream.impact(String, Score)
instead.The
Constraint.getConstraintPackage()
defaults toConstraintConfiguration.constraintPackage()
.- Parameters:
constraintName
- never null, shows up inConstraintMatchTotal
during 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
-
impact(Score, ToIntFunction)
.