Interface QuadConstraintStream<A,B,C,D>
-
- Type Parameters:
A
- the type of the first matched fact (either a problem fact or aplanning entity
)B
- the type of the second matched fact (either a problem fact or aplanning entity
)C
- the type of the third matched fact (either a problem fact or aplanning entity
)D
- the type of the fourth matched fact (either a problem fact or aplanning entity
)
- All Superinterfaces:
ConstraintStream
- All Known Subinterfaces:
InnerQuadConstraintStream<A,B,C,D>
- All Known Implementing Classes:
DroolsAbstractQuadConstraintStream
,DroolsExistsQuadConstraintStream
,DroolsFilterQuadConstraintStream
,DroolsFlatteningQuadConstraintStream
,DroolsGroupingQuadConstraintStream
,DroolsJoinQuadConstraintStream
public interface QuadConstraintStream<A,B,C,D> extends ConstraintStream
AConstraintStream
that matches four facts.- See Also:
ConstraintStream
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description QuadConstraintStream<A,B,C,D>
distinct()
Transforms the stream in such a way that all the tuples going through it are distinct.QuadConstraintStream<A,B,C,D>
filter(QuadPredicate<A,B,C,D> predicate)
Exhaustively test each tuple of facts against theQuadPredicate
and match ifQuadPredicate.test(Object, Object, Object, Object)
returns true.<ResultD_> QuadConstraintStream<A,B,C,ResultD_>
flattenLast(Function<D,Iterable<ResultD_>> mapping)
As defined byBiConstraintStream.flattenLast(Function)
.<GroupKey_>
UniConstraintStream<GroupKey_>groupBy(QuadFunction<A,B,C,D,GroupKey_> groupKeyMapping)
Convert theQuadConstraintStream
to aUniConstraintStream
, containing the set of tuples resulting from applying the group key mapping function on all tuples of the original stream.<GroupKey_,ResultContainer_,Result_>
BiConstraintStream<GroupKey_,Result_>groupBy(QuadFunction<A,B,C,D,GroupKey_> groupKeyMapping, QuadConstraintCollector<A,B,C,D,ResultContainer_,Result_> collector)
Convert theQuadConstraintStream
to aBiConstraintStream
, consisting of unique tuples.<GroupKey_,ResultContainerB_,ResultB_,ResultContainerC_,ResultC_>
TriConstraintStream<GroupKey_,ResultB_,ResultC_>groupBy(QuadFunction<A,B,C,D,GroupKey_> groupKeyMapping, QuadConstraintCollector<A,B,C,D,ResultContainerB_,ResultB_> collectorB, QuadConstraintCollector<A,B,C,D,ResultContainerC_,ResultC_> collectorC)
Convert theQuadConstraintStream
to aTriConstraintStream
, consisting of unique tuples with three facts.<GroupKey_,ResultContainerB_,ResultB_,ResultContainerC_,ResultC_,ResultContainerD_,ResultD_>
QuadConstraintStream<GroupKey_,ResultB_,ResultC_,ResultD_>groupBy(QuadFunction<A,B,C,D,GroupKey_> groupKeyMapping, QuadConstraintCollector<A,B,C,D,ResultContainerB_,ResultB_> collectorB, QuadConstraintCollector<A,B,C,D,ResultContainerC_,ResultC_> collectorC, QuadConstraintCollector<A,B,C,D,ResultContainerD_,ResultD_> collectorD)
Convert theQuadConstraintStream
to aQuadConstraintStream
, consisting of unique tuples with four facts.<GroupKeyA_,GroupKeyB_>
BiConstraintStream<GroupKeyA_,GroupKeyB_>groupBy(QuadFunction<A,B,C,D,GroupKeyA_> groupKeyAMapping, QuadFunction<A,B,C,D,GroupKeyB_> groupKeyBMapping)
Convert theQuadConstraintStream
to aBiConstraintStream
, consisting of unique tuples.<GroupKeyA_,GroupKeyB_,GroupKeyC_>
TriConstraintStream<GroupKeyA_,GroupKeyB_,GroupKeyC_>groupBy(QuadFunction<A,B,C,D,GroupKeyA_> groupKeyAMapping, QuadFunction<A,B,C,D,GroupKeyB_> groupKeyBMapping, QuadFunction<A,B,C,D,GroupKeyC_> groupKeyCMapping)
Convert theQuadConstraintStream
to aTriConstraintStream
, consisting of unique tuples with three facts.<GroupKeyA_,GroupKeyB_,GroupKeyC_,GroupKeyD_>
QuadConstraintStream<GroupKeyA_,GroupKeyB_,GroupKeyC_,GroupKeyD_>groupBy(QuadFunction<A,B,C,D,GroupKeyA_> groupKeyAMapping, QuadFunction<A,B,C,D,GroupKeyB_> groupKeyBMapping, QuadFunction<A,B,C,D,GroupKeyC_> groupKeyCMapping, QuadFunction<A,B,C,D,GroupKeyD_> groupKeyDMapping)
Convert theTriConstraintStream
to aQuadConstraintStream
, consisting of unique tuples with four facts.<GroupKeyA_,GroupKeyB_,GroupKeyC_,ResultContainerD_,ResultD_>
QuadConstraintStream<GroupKeyA_,GroupKeyB_,GroupKeyC_,ResultD_>groupBy(QuadFunction<A,B,C,D,GroupKeyA_> groupKeyAMapping, QuadFunction<A,B,C,D,GroupKeyB_> groupKeyBMapping, QuadFunction<A,B,C,D,GroupKeyC_> groupKeyCMapping, QuadConstraintCollector<A,B,C,D,ResultContainerD_,ResultD_> collectorD)
Combines the semantics ofgroupBy(QuadFunction, QuadFunction)
andgroupBy(QuadConstraintCollector)
.<GroupKeyA_,GroupKeyB_,ResultContainer_,Result_>
TriConstraintStream<GroupKeyA_,GroupKeyB_,Result_>groupBy(QuadFunction<A,B,C,D,GroupKeyA_> groupKeyAMapping, QuadFunction<A,B,C,D,GroupKeyB_> groupKeyBMapping, QuadConstraintCollector<A,B,C,D,ResultContainer_,Result_> collector)
Combines the semantics ofgroupBy(QuadFunction, QuadFunction)
andgroupBy(QuadConstraintCollector)
.<GroupKeyA_,GroupKeyB_,ResultContainerC_,ResultC_,ResultContainerD_,ResultD_>
QuadConstraintStream<GroupKeyA_,GroupKeyB_,ResultC_,ResultD_>groupBy(QuadFunction<A,B,C,D,GroupKeyA_> groupKeyAMapping, QuadFunction<A,B,C,D,GroupKeyB_> groupKeyBMapping, QuadConstraintCollector<A,B,C,D,ResultContainerC_,ResultC_> collectorC, QuadConstraintCollector<A,B,C,D,ResultContainerD_,ResultD_> collectorD)
Combines the semantics ofgroupBy(QuadFunction, QuadFunction)
andgroupBy(QuadConstraintCollector)
.<ResultContainer_,Result_>
UniConstraintStream<Result_>groupBy(QuadConstraintCollector<A,B,C,D,ResultContainer_,Result_> collector)
Convert theQuadConstraintStream
to aUniConstraintStream
, containing only a single tuple, the result of applyingQuadConstraintCollector
.<ResultContainerA_,ResultA_,ResultContainerB_,ResultB_>
BiConstraintStream<ResultA_,ResultB_>groupBy(QuadConstraintCollector<A,B,C,D,ResultContainerA_,ResultA_> collectorA, QuadConstraintCollector<A,B,C,D,ResultContainerB_,ResultB_> collectorB)
Convert theQuadConstraintStream
to aBiConstraintStream
, containing only a single tuple, the result of applying twoQuadConstraintCollector
s.<ResultContainerA_,ResultA_,ResultContainerB_,ResultB_,ResultContainerC_,ResultC_>
TriConstraintStream<ResultA_,ResultB_,ResultC_>groupBy(QuadConstraintCollector<A,B,C,D,ResultContainerA_,ResultA_> collectorA, QuadConstraintCollector<A,B,C,D,ResultContainerB_,ResultB_> collectorB, QuadConstraintCollector<A,B,C,D,ResultContainerC_,ResultC_> collectorC)
Convert theQuadConstraintStream
to aTriConstraintStream
, containing only a single tuple, the result of applying threeQuadConstraintCollector
s.<ResultContainerA_,ResultA_,ResultContainerB_,ResultB_,ResultContainerC_,ResultC_,ResultContainerD_,ResultD_>
QuadConstraintStream<ResultA_,ResultB_,ResultC_,ResultD_>groupBy(QuadConstraintCollector<A,B,C,D,ResultContainerA_,ResultA_> collectorA, QuadConstraintCollector<A,B,C,D,ResultContainerB_,ResultB_> collectorB, QuadConstraintCollector<A,B,C,D,ResultContainerC_,ResultC_> collectorC, QuadConstraintCollector<A,B,C,D,ResultContainerD_,ResultD_> collectorD)
Convert theQuadConstraintStream
to aQuadConstraintStream
, containing only a single tuple, the result of applying fourQuadConstraintCollector
s.default <E> QuadConstraintStream<A,B,C,D>
ifExists(Class<E> otherClass, PentaJoiner<A,B,C,D,E> joiner)
Create a newBiConstraintStream
for every tuple of A, B, C and D where E exists for which thePentaJoiner
is true (for the properties it extracts from the facts).<E> QuadConstraintStream<A,B,C,D>
ifExists(Class<E> otherClass, PentaJoiner<A,B,C,D,E>... joiners)
As defined byifExists(Class, PentaJoiner)
.default <E> QuadConstraintStream<A,B,C,D>
ifExists(Class<E> otherClass, PentaJoiner<A,B,C,D,E> joiner1, PentaJoiner<A,B,C,D,E> joiner2)
As defined byifExists(Class, PentaJoiner)
.default <E> QuadConstraintStream<A,B,C,D>
ifExists(Class<E> otherClass, PentaJoiner<A,B,C,D,E> joiner1, PentaJoiner<A,B,C,D,E> joiner2, PentaJoiner<A,B,C,D,E> joiner3)
As defined byifExists(Class, PentaJoiner)
.default <E> QuadConstraintStream<A,B,C,D>
ifExists(Class<E> otherClass, PentaJoiner<A,B,C,D,E> joiner1, PentaJoiner<A,B,C,D,E> joiner2, PentaJoiner<A,B,C,D,E> joiner3, PentaJoiner<A,B,C,D,E> joiner4)
As defined byifExists(Class, PentaJoiner)
.default <E> QuadConstraintStream<A,B,C,D>
ifExistsIncludingNullVars(Class<E> otherClass, PentaJoiner<A,B,C,D,E> joiner)
Create a newBiConstraintStream
for every tuple of A, B, C and D where E exists for which thePentaJoiner
is true (for the properties it extracts from the facts).<E> QuadConstraintStream<A,B,C,D>
ifExistsIncludingNullVars(Class<E> otherClass, PentaJoiner<A,B,C,D,E>... joiners)
As defined byifExistsIncludingNullVars(Class, PentaJoiner)
.default <E> QuadConstraintStream<A,B,C,D>
ifExistsIncludingNullVars(Class<E> otherClass, PentaJoiner<A,B,C,D,E> joiner1, PentaJoiner<A,B,C,D,E> joiner2)
As defined byifExistsIncludingNullVars(Class, PentaJoiner)
.default <E> QuadConstraintStream<A,B,C,D>
ifExistsIncludingNullVars(Class<E> otherClass, PentaJoiner<A,B,C,D,E> joiner1, PentaJoiner<A,B,C,D,E> joiner2, PentaJoiner<A,B,C,D,E> joiner3)
As defined byifExistsIncludingNullVars(Class, PentaJoiner)
.default <E> QuadConstraintStream<A,B,C,D>
ifExistsIncludingNullVars(Class<E> otherClass, PentaJoiner<A,B,C,D,E> joiner1, PentaJoiner<A,B,C,D,E> joiner2, PentaJoiner<A,B,C,D,E> joiner3, PentaJoiner<A,B,C,D,E> joiner4)
As defined byifExistsIncludingNullVars(Class, PentaJoiner)
.default <E> QuadConstraintStream<A,B,C,D>
ifNotExists(Class<E> otherClass, PentaJoiner<A,B,C,D,E> joiner)
Create a newBiConstraintStream
for every tuple of A, B, C and D where E does not exist for which thePentaJoiner
is true (for the properties it extracts from the facts).<E> QuadConstraintStream<A,B,C,D>
ifNotExists(Class<E> otherClass, PentaJoiner<A,B,C,D,E>... joiners)
As defined byifNotExists(Class, PentaJoiner)
.default <E> QuadConstraintStream<A,B,C,D>
ifNotExists(Class<E> otherClass, PentaJoiner<A,B,C,D,E> joiner1, PentaJoiner<A,B,C,D,E> joiner2)
As defined byifNotExists(Class, PentaJoiner)
.default <E> QuadConstraintStream<A,B,C,D>
ifNotExists(Class<E> otherClass, PentaJoiner<A,B,C,D,E> joiner1, PentaJoiner<A,B,C,D,E> joiner2, PentaJoiner<A,B,C,D,E> joiner3)
As defined byifNotExists(Class, PentaJoiner)
.default <E> QuadConstraintStream<A,B,C,D>
ifNotExists(Class<E> otherClass, PentaJoiner<A,B,C,D,E> joiner1, PentaJoiner<A,B,C,D,E> joiner2, PentaJoiner<A,B,C,D,E> joiner3, PentaJoiner<A,B,C,D,E> joiner4)
As defined byifNotExists(Class, PentaJoiner)
.default <E> QuadConstraintStream<A,B,C,D>
ifNotExistsIncludingNullVars(Class<E> otherClass, PentaJoiner<A,B,C,D,E> joiner)
Create a newBiConstraintStream
for every tuple of A, B, C and D where E does not exist for which thePentaJoiner
is true (for the properties it extracts from the facts).<E> QuadConstraintStream<A,B,C,D>
ifNotExistsIncludingNullVars(Class<E> otherClass, PentaJoiner<A,B,C,D,E>... joiners)
As defined byifNotExistsIncludingNullVars(Class, PentaJoiner)
.default <E> QuadConstraintStream<A,B,C,D>
ifNotExistsIncludingNullVars(Class<E> otherClass, PentaJoiner<A,B,C,D,E> joiner1, PentaJoiner<A,B,C,D,E> joiner2)
As defined byifNotExistsIncludingNullVars(Class, PentaJoiner)
.default <E> QuadConstraintStream<A,B,C,D>
ifNotExistsIncludingNullVars(Class<E> otherClass, PentaJoiner<A,B,C,D,E> joiner1, PentaJoiner<A,B,C,D,E> joiner2, PentaJoiner<A,B,C,D,E> joiner3)
As defined byifNotExistsIncludingNullVars(Class, PentaJoiner)
.default <E> QuadConstraintStream<A,B,C,D>
ifNotExistsIncludingNullVars(Class<E> otherClass, PentaJoiner<A,B,C,D,E> joiner1, PentaJoiner<A,B,C,D,E> joiner2, PentaJoiner<A,B,C,D,E> joiner3, PentaJoiner<A,B,C,D,E> joiner4)
As defined byifNotExistsIncludingNullVars(Class, PentaJoiner)
.Constraint
impact(String constraintPackage, String constraintName, Score<?> constraintWeight, ToIntQuadFunction<A,B,C,D> matchWeigher)
As defined byimpact(String, Score, ToIntQuadFunction)
.default Constraint
impact(String constraintName, Score<?> constraintWeight, ToIntQuadFunction<A,B,C,D> matchWeigher)
Positively or negatively impact theScore
by the constraintWeight multiplied by the match weight.Constraint
impactBigDecimal(String constraintPackage, String constraintName, Score<?> constraintWeight, QuadFunction<A,B,C,D,BigDecimal> matchWeigher)
As defined byimpactBigDecimal(String, Score, QuadFunction)
.default Constraint
impactBigDecimal(String constraintName, Score<?> constraintWeight, QuadFunction<A,B,C,D,BigDecimal> matchWeigher)
Positively or negatively impact theScore
by the constraintWeight multiplied by the match weight.Constraint
impactConfigurable(String constraintPackage, String constraintName, ToIntQuadFunction<A,B,C,D> matchWeigher)
As defined byimpactConfigurable(String, ToIntQuadFunction)
.default Constraint
impactConfigurable(String constraintName, ToIntQuadFunction<A,B,C,D> matchWeigher)
Positively or negatively impact theScore
by theConstraintWeight
for each match.Constraint
impactConfigurableBigDecimal(String constraintPackage, String constraintName, QuadFunction<A,B,C,D,BigDecimal> matchWeigher)
As defined byimpactConfigurableBigDecimal(String, QuadFunction)
.default Constraint
impactConfigurableBigDecimal(String constraintName, QuadFunction<A,B,C,D,BigDecimal> matchWeigher)
Positively or negatively impact theScore
by theConstraintWeight
for each match.Constraint
impactConfigurableLong(String constraintPackage, String constraintName, ToLongQuadFunction<A,B,C,D> matchWeigher)
As defined byimpactConfigurableLong(String, ToLongQuadFunction)
.default Constraint
impactConfigurableLong(String constraintName, ToLongQuadFunction<A,B,C,D> matchWeigher)
Positively or negatively impact theScore
by theConstraintWeight
for each match.Constraint
impactLong(String constraintPackage, String constraintName, Score<?> constraintWeight, ToLongQuadFunction<A,B,C,D> matchWeigher)
As defined byimpactLong(String, Score, ToLongQuadFunction)
.default Constraint
impactLong(String constraintName, Score<?> constraintWeight, ToLongQuadFunction<A,B,C,D> matchWeigher)
Positively or negatively impact theScore
by the constraintWeight multiplied by the match weight.<ResultA_> UniConstraintStream<ResultA_>
map(QuadFunction<A,B,C,D,ResultA_> mapping)
As defined byUniConstraintStream.map(Function)
.Constraint
penalize(String constraintPackage, String constraintName, Score<?> constraintWeight, ToIntQuadFunction<A,B,C,D> matchWeigher)
As defined bypenalize(String, Score, ToIntQuadFunction)
.default Constraint
penalize(String constraintName, Score<?> constraintWeight, ToIntQuadFunction<A,B,C,D> matchWeigher)
Negatively impact theScore
: subtract the constraintWeight multiplied by the match weight.Constraint
penalizeBigDecimal(String constraintPackage, String constraintName, Score<?> constraintWeight, QuadFunction<A,B,C,D,BigDecimal> matchWeigher)
As defined bypenalizeBigDecimal(String, Score, QuadFunction)
.default Constraint
penalizeBigDecimal(String constraintName, Score<?> constraintWeight, QuadFunction<A,B,C,D,BigDecimal> matchWeigher)
Negatively impact theScore
: subtract the constraintWeight multiplied by the match weight.Constraint
penalizeConfigurable(String constraintPackage, String constraintName, ToIntQuadFunction<A,B,C,D> matchWeigher)
As defined bypenalizeConfigurable(String, ToIntQuadFunction)
.default Constraint
penalizeConfigurable(String constraintName, ToIntQuadFunction<A,B,C,D> matchWeigher)
Negatively impact theScore
: subtract theConstraintWeight
multiplied by the match weight.Constraint
penalizeConfigurableBigDecimal(String constraintPackage, String constraintName, QuadFunction<A,B,C,D,BigDecimal> matchWeigher)
As defined bypenalizeConfigurableBigDecimal(String, QuadFunction)
.default Constraint
penalizeConfigurableBigDecimal(String constraintName, QuadFunction<A,B,C,D,BigDecimal> matchWeigher)
Negatively impact theScore
: subtract theConstraintWeight
multiplied by the match weight.Constraint
penalizeConfigurableLong(String constraintPackage, String constraintName, ToLongQuadFunction<A,B,C,D> matchWeigher)
As defined bypenalizeConfigurableLong(String, ToLongQuadFunction)
.default Constraint
penalizeConfigurableLong(String constraintName, ToLongQuadFunction<A,B,C,D> matchWeigher)
Negatively impact theScore
: subtract theConstraintWeight
multiplied by the match weight.Constraint
penalizeLong(String constraintPackage, String constraintName, Score<?> constraintWeight, ToLongQuadFunction<A,B,C,D> matchWeigher)
As defined bypenalizeLong(String, Score, ToLongQuadFunction)
.default Constraint
penalizeLong(String constraintName, Score<?> constraintWeight, ToLongQuadFunction<A,B,C,D> matchWeigher)
Negatively impact theScore
: subtract the constraintWeight multiplied by the match weight.Constraint
reward(String constraintPackage, String constraintName, Score<?> constraintWeight, ToIntQuadFunction<A,B,C,D> matchWeigher)
As defined byreward(String, Score, ToIntQuadFunction)
.default Constraint
reward(String constraintName, Score<?> constraintWeight, ToIntQuadFunction<A,B,C,D> matchWeigher)
Positively impact theScore
: add the constraintWeight multiplied by the match weight.Constraint
rewardBigDecimal(String constraintPackage, String constraintName, Score<?> constraintWeight, QuadFunction<A,B,C,D,BigDecimal> matchWeigher)
As defined byrewardBigDecimal(String, Score, QuadFunction)
.default Constraint
rewardBigDecimal(String constraintName, Score<?> constraintWeight, QuadFunction<A,B,C,D,BigDecimal> matchWeigher)
Positively impact theScore
: add the constraintWeight multiplied by the match weight.Constraint
rewardConfigurable(String constraintPackage, String constraintName, ToIntQuadFunction<A,B,C,D> matchWeigher)
As defined byrewardConfigurable(String, ToIntQuadFunction)
.default Constraint
rewardConfigurable(String constraintName, ToIntQuadFunction<A,B,C,D> matchWeigher)
Positively impact theScore
: add theConstraintWeight
multiplied by the match weight.Constraint
rewardConfigurableBigDecimal(String constraintPackage, String constraintName, QuadFunction<A,B,C,D,BigDecimal> matchWeigher)
As defined byrewardConfigurableBigDecimal(String, QuadFunction)
.default Constraint
rewardConfigurableBigDecimal(String constraintName, QuadFunction<A,B,C,D,BigDecimal> matchWeigher)
Positively impact theScore
: add theConstraintWeight
multiplied by the match weight.Constraint
rewardConfigurableLong(String constraintPackage, String constraintName, ToLongQuadFunction<A,B,C,D> matchWeigher)
As defined byrewardConfigurableLong(String, ToLongQuadFunction)
.default Constraint
rewardConfigurableLong(String constraintName, ToLongQuadFunction<A,B,C,D> matchWeigher)
Positively impact theScore
: add theConstraintWeight
multiplied by the match weight.Constraint
rewardLong(String constraintPackage, String constraintName, Score<?> constraintWeight, ToLongQuadFunction<A,B,C,D> matchWeigher)
As defined byrewardLong(String, Score, ToLongQuadFunction)
.default Constraint
rewardLong(String constraintName, Score<?> constraintWeight, ToLongQuadFunction<A,B,C,D> matchWeigher)
Positively impact theScore
: add the constraintWeight multiplied by the match weight.-
Methods inherited from interface org.optaplanner.core.api.score.stream.ConstraintStream
getConstraintFactory, impact, impact, penalize, penalize, penalizeConfigurable, penalizeConfigurable, reward, reward, rewardConfigurable, rewardConfigurable
-
-
-
-
Method Detail
-
filter
QuadConstraintStream<A,B,C,D> filter(QuadPredicate<A,B,C,D> predicate)
Exhaustively test each tuple of facts against theQuadPredicate
and match ifQuadPredicate.test(Object, Object, Object, Object)
returns true.Important: This is slower and less scalable than
TriConstraintStream.join(UniConstraintStream, QuadJoiner)
with a properQuadJoiner
predicate (such asJoiners.equal(TriFunction, Function)
, because the latter applies hashing and/or indexing, so it doesn't create every combination just to filter it out.- Parameters:
predicate
- never null- Returns:
- never null
-
ifExists
default <E> QuadConstraintStream<A,B,C,D> ifExists(Class<E> otherClass, PentaJoiner<A,B,C,D,E> joiner)
Create a newBiConstraintStream
for every tuple of A, B, C and D where E exists for which thePentaJoiner
is true (for the properties it extracts from the facts).This method has overloaded methods with multiple
PentaJoiner
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:
E
- the type of the fifth matched fact- Parameters:
otherClass
- never nulljoiner
- never null- Returns:
- never null, a stream that matches every tuple of A, B, C and D where E exists for which the
PentaJoiner
is true
-
ifExists
default <E> QuadConstraintStream<A,B,C,D> ifExists(Class<E> otherClass, PentaJoiner<A,B,C,D,E> joiner1, PentaJoiner<A,B,C,D,E> joiner2)
As defined byifExists(Class, PentaJoiner)
. For performance reasons, indexing joiners must be placed before filtering joiners.- Type Parameters:
E
- the type of the fifth matched fact- Parameters:
otherClass
- never nulljoiner1
- never nulljoiner2
- never null- Returns:
- never null, a stream that matches every tuple of A, B, C and D where E exists for which the
PentaJoiner
s are true
-
ifExists
default <E> QuadConstraintStream<A,B,C,D> ifExists(Class<E> otherClass, PentaJoiner<A,B,C,D,E> joiner1, PentaJoiner<A,B,C,D,E> joiner2, PentaJoiner<A,B,C,D,E> joiner3)
As defined byifExists(Class, PentaJoiner)
. For performance reasons, indexing joiners must be placed before filtering joiners.- Type Parameters:
E
- the type of the fifth matched fact- Parameters:
otherClass
- never nulljoiner1
- never nulljoiner2
- never nulljoiner3
- never null- Returns:
- never null, a stream that matches every tuple of A, B, C and D where E exists for which the
PentaJoiner
s are true
-
ifExists
default <E> QuadConstraintStream<A,B,C,D> ifExists(Class<E> otherClass, PentaJoiner<A,B,C,D,E> joiner1, PentaJoiner<A,B,C,D,E> joiner2, PentaJoiner<A,B,C,D,E> joiner3, PentaJoiner<A,B,C,D,E> joiner4)
As defined byifExists(Class, PentaJoiner)
. For performance reasons, indexing joiners must be placed before filtering joiners.- Type Parameters:
E
- the type of the fifth matched fact- Parameters:
otherClass
- never nulljoiner1
- never nulljoiner2
- never nulljoiner3
- never nulljoiner4
- never null- Returns:
- never null, a stream that matches every tuple of A, B, C and D where E exists for which the
PentaJoiner
s are true
-
ifExists
<E> QuadConstraintStream<A,B,C,D> ifExists(Class<E> otherClass, PentaJoiner<A,B,C,D,E>... joiners)
As defined byifExists(Class, PentaJoiner)
. 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 4PentaJoiner
parameters.- Type Parameters:
E
- the type of the fifth matched fact- Parameters:
otherClass
- never nulljoiners
- never null- Returns:
- never null, a stream that matches every tuple of A, B, C and D where E exists for which the
PentaJoiner
s are true
-
ifExistsIncludingNullVars
default <E> QuadConstraintStream<A,B,C,D> ifExistsIncludingNullVars(Class<E> otherClass, PentaJoiner<A,B,C,D,E> joiner)
Create a newBiConstraintStream
for every tuple of A, B, C and D where E exists for which thePentaJoiner
is true (for the properties it extracts from the facts). For classes annotated withPlanningEntity
, this method also includes instances with null variables.This method has overloaded methods with multiple
PentaJoiner
parameters.- Type Parameters:
E
- the type of the fifth matched fact- Parameters:
otherClass
- never nulljoiner
- never null- Returns:
- never null, a stream that matches every tuple of A, B, C and D where E exists for which the
PentaJoiner
is true
-
ifExistsIncludingNullVars
default <E> QuadConstraintStream<A,B,C,D> ifExistsIncludingNullVars(Class<E> otherClass, PentaJoiner<A,B,C,D,E> joiner1, PentaJoiner<A,B,C,D,E> joiner2)
As defined byifExistsIncludingNullVars(Class, PentaJoiner)
. For performance reasons, indexing joiners must be placed before filtering joiners.- Type Parameters:
E
- the type of the fifth matched fact- Parameters:
otherClass
- never nulljoiner1
- never nulljoiner2
- never null- Returns:
- never null, a stream that matches every tuple of A, B, C and D where E exists for which the
PentaJoiner
s are true
-
ifExistsIncludingNullVars
default <E> QuadConstraintStream<A,B,C,D> ifExistsIncludingNullVars(Class<E> otherClass, PentaJoiner<A,B,C,D,E> joiner1, PentaJoiner<A,B,C,D,E> joiner2, PentaJoiner<A,B,C,D,E> joiner3)
As defined byifExistsIncludingNullVars(Class, PentaJoiner)
. For performance reasons, indexing joiners must be placed before filtering joiners.- Type Parameters:
E
- the type of the fifth matched fact- Parameters:
otherClass
- never nulljoiner1
- never nulljoiner2
- never nulljoiner3
- never null- Returns:
- never null, a stream that matches every tuple of A, B, C and D where E exists for which the
PentaJoiner
s are true
-
ifExistsIncludingNullVars
default <E> QuadConstraintStream<A,B,C,D> ifExistsIncludingNullVars(Class<E> otherClass, PentaJoiner<A,B,C,D,E> joiner1, PentaJoiner<A,B,C,D,E> joiner2, PentaJoiner<A,B,C,D,E> joiner3, PentaJoiner<A,B,C,D,E> joiner4)
As defined byifExistsIncludingNullVars(Class, PentaJoiner)
. For performance reasons, indexing joiners must be placed before filtering joiners.- Type Parameters:
E
- the type of the fifth matched fact- Parameters:
otherClass
- never nulljoiner1
- never nulljoiner2
- never nulljoiner3
- never nulljoiner4
- never null- Returns:
- never null, a stream that matches every tuple of A, B, C and D where E exists for which the
PentaJoiner
s are true
-
ifExistsIncludingNullVars
<E> QuadConstraintStream<A,B,C,D> ifExistsIncludingNullVars(Class<E> otherClass, PentaJoiner<A,B,C,D,E>... joiners)
As defined byifExistsIncludingNullVars(Class, PentaJoiner)
. 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 4PentaJoiner
parameters.- Type Parameters:
E
- the type of the fifth matched fact- Parameters:
otherClass
- never nulljoiners
- never null- Returns:
- never null, a stream that matches every tuple of A, B, C and D where E exists for which the
PentaJoiner
s are true
-
ifNotExists
default <E> QuadConstraintStream<A,B,C,D> ifNotExists(Class<E> otherClass, PentaJoiner<A,B,C,D,E> joiner)
Create a newBiConstraintStream
for every tuple of A, B, C and D where E does not exist for which thePentaJoiner
is true (for the properties it extracts from the facts).This method has overloaded methods with multiple
PentaJoiner
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:
E
- the type of the fifth matched fact- Parameters:
otherClass
- never nulljoiner
- never null- Returns:
- never null, a stream that matches every tuple of A, B, C and D where E does not exist for which the
PentaJoiner
is true
-
ifNotExists
default <E> QuadConstraintStream<A,B,C,D> ifNotExists(Class<E> otherClass, PentaJoiner<A,B,C,D,E> joiner1, PentaJoiner<A,B,C,D,E> joiner2)
As defined byifNotExists(Class, PentaJoiner)
. For performance reasons, indexing joiners must be placed before filtering joiners.- Type Parameters:
E
- the type of the fifth matched fact- Parameters:
otherClass
- never nulljoiner1
- never nulljoiner2
- never null- Returns:
- never null, a stream that matches every tuple of A, B, C and D where E does not exist for which the
PentaJoiner
s are true
-
ifNotExists
default <E> QuadConstraintStream<A,B,C,D> ifNotExists(Class<E> otherClass, PentaJoiner<A,B,C,D,E> joiner1, PentaJoiner<A,B,C,D,E> joiner2, PentaJoiner<A,B,C,D,E> joiner3)
As defined byifNotExists(Class, PentaJoiner)
. For performance reasons, indexing joiners must be placed before filtering joiners.- Type Parameters:
E
- the type of the fifth matched fact- Parameters:
otherClass
- never nulljoiner1
- never nulljoiner2
- never nulljoiner3
- never null- Returns:
- never null, a stream that matches every tuple of A, B, C and D where E does not exist for which the
PentaJoiner
s are true
-
ifNotExists
default <E> QuadConstraintStream<A,B,C,D> ifNotExists(Class<E> otherClass, PentaJoiner<A,B,C,D,E> joiner1, PentaJoiner<A,B,C,D,E> joiner2, PentaJoiner<A,B,C,D,E> joiner3, PentaJoiner<A,B,C,D,E> joiner4)
As defined byifNotExists(Class, PentaJoiner)
. For performance reasons, indexing joiners must be placed before filtering joiners.- Type Parameters:
E
- the type of the fifth matched fact- Parameters:
otherClass
- never nulljoiner1
- never nulljoiner2
- never nulljoiner3
- never nulljoiner4
- never null- Returns:
- never null, a stream that matches every tuple of A, B, C and D where E does not exist for which the
PentaJoiner
s are true
-
ifNotExists
<E> QuadConstraintStream<A,B,C,D> ifNotExists(Class<E> otherClass, PentaJoiner<A,B,C,D,E>... joiners)
As defined byifNotExists(Class, PentaJoiner)
. 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 4PentaJoiner
parameters.- Type Parameters:
E
- the type of the fifth matched fact- Parameters:
otherClass
- never nulljoiners
- never null- Returns:
- never null, a stream that matches every tuple of A, B, C and D where E does not exist for which the
PentaJoiner
s are true
-
ifNotExistsIncludingNullVars
default <E> QuadConstraintStream<A,B,C,D> ifNotExistsIncludingNullVars(Class<E> otherClass, PentaJoiner<A,B,C,D,E> joiner)
Create a newBiConstraintStream
for every tuple of A, B, C and D where E does not exist for which thePentaJoiner
is true (for the properties it extracts from the facts). For classes annotated withPlanningEntity
, this method also includes instances with null variables.This method has overloaded methods with multiple
PentaJoiner
parameters.- Type Parameters:
E
- the type of the fifth matched fact- Parameters:
otherClass
- never nulljoiner
- never null- Returns:
- never null, a stream that matches every tuple of A, B, C and D where E does not exist for which the
PentaJoiner
is true
-
ifNotExistsIncludingNullVars
default <E> QuadConstraintStream<A,B,C,D> ifNotExistsIncludingNullVars(Class<E> otherClass, PentaJoiner<A,B,C,D,E> joiner1, PentaJoiner<A,B,C,D,E> joiner2)
As defined byifNotExistsIncludingNullVars(Class, PentaJoiner)
. For performance reasons, indexing joiners must be placed before filtering joiners.- Type Parameters:
E
- the type of the fifth matched fact- Parameters:
otherClass
- never nulljoiner1
- never nulljoiner2
- never null- Returns:
- never null, a stream that matches every tuple of A, B, C and D where E does not exist for which the
PentaJoiner
s are true
-
ifNotExistsIncludingNullVars
default <E> QuadConstraintStream<A,B,C,D> ifNotExistsIncludingNullVars(Class<E> otherClass, PentaJoiner<A,B,C,D,E> joiner1, PentaJoiner<A,B,C,D,E> joiner2, PentaJoiner<A,B,C,D,E> joiner3)
As defined byifNotExistsIncludingNullVars(Class, PentaJoiner)
. For performance reasons, indexing joiners must be placed before filtering joiners.- Type Parameters:
E
- the type of the fifth matched fact- Parameters:
otherClass
- never nulljoiner1
- never nulljoiner2
- never nulljoiner3
- never null- Returns:
- never null, a stream that matches every tuple of A, B, C and D where E does not exist for which the
PentaJoiner
s are true
-
ifNotExistsIncludingNullVars
default <E> QuadConstraintStream<A,B,C,D> ifNotExistsIncludingNullVars(Class<E> otherClass, PentaJoiner<A,B,C,D,E> joiner1, PentaJoiner<A,B,C,D,E> joiner2, PentaJoiner<A,B,C,D,E> joiner3, PentaJoiner<A,B,C,D,E> joiner4)
As defined byifNotExistsIncludingNullVars(Class, PentaJoiner)
. For performance reasons, indexing joiners must be placed before filtering joiners.- Type Parameters:
E
- the type of the fifth matched fact- Parameters:
otherClass
- never nulljoiner1
- never nulljoiner2
- never nulljoiner3
- never nulljoiner4
- never null- Returns:
- never null, a stream that matches every tuple of A, B, C and D where E does not exist for which the
PentaJoiner
s are true
-
ifNotExistsIncludingNullVars
<E> QuadConstraintStream<A,B,C,D> ifNotExistsIncludingNullVars(Class<E> otherClass, PentaJoiner<A,B,C,D,E>... joiners)
As defined byifNotExistsIncludingNullVars(Class, PentaJoiner)
. 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 4PentaJoiner
parameters.- Type Parameters:
E
- the type of the fifth matched fact- Parameters:
otherClass
- never nulljoiners
- never null- Returns:
- never null, a stream that matches every tuple of A, B, C and D where E does not exist for which the
PentaJoiner
s are true
-
groupBy
<ResultContainer_,Result_> UniConstraintStream<Result_> groupBy(QuadConstraintCollector<A,B,C,D,ResultContainer_,Result_> collector)
Convert theQuadConstraintStream
to aUniConstraintStream
, containing only a single tuple, the result of applyingQuadConstraintCollector
.UniConstraintStream
which only has a single tuple, the result of applyingQuadConstraintCollector
.- 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_,ResultContainerB_,ResultB_> BiConstraintStream<ResultA_,ResultB_> groupBy(QuadConstraintCollector<A,B,C,D,ResultContainerA_,ResultA_> collectorA, QuadConstraintCollector<A,B,C,D,ResultContainerB_,ResultB_> collectorB)
Convert theQuadConstraintStream
to aBiConstraintStream
, containing only a single tuple, the result of applying twoQuadConstraintCollector
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_,ResultContainerB_,ResultB_,ResultContainerC_,ResultC_> TriConstraintStream<ResultA_,ResultB_,ResultC_> groupBy(QuadConstraintCollector<A,B,C,D,ResultContainerA_,ResultA_> collectorA, QuadConstraintCollector<A,B,C,D,ResultContainerB_,ResultB_> collectorB, QuadConstraintCollector<A,B,C,D,ResultContainerC_,ResultC_> collectorC)
Convert theQuadConstraintStream
to aTriConstraintStream
, containing only a single tuple, the result of applying threeQuadConstraintCollector
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_,ResultContainerB_,ResultB_,ResultContainerC_,ResultC_,ResultContainerD_,ResultD_> QuadConstraintStream<ResultA_,ResultB_,ResultC_,ResultD_> groupBy(QuadConstraintCollector<A,B,C,D,ResultContainerA_,ResultA_> collectorA, QuadConstraintCollector<A,B,C,D,ResultContainerB_,ResultB_> collectorB, QuadConstraintCollector<A,B,C,D,ResultContainerC_,ResultC_> collectorC, QuadConstraintCollector<A,B,C,D,ResultContainerD_,ResultD_> collectorD)
Convert theQuadConstraintStream
to aQuadConstraintStream
, containing only a single tuple, the result of applying fourQuadConstraintCollector
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
<GroupKey_> UniConstraintStream<GroupKey_> groupBy(QuadFunction<A,B,C,D,GroupKey_> groupKeyMapping)
Convert theQuadConstraintStream
to aUniConstraintStream
, containing the set of tuples resulting from applying the group key mapping function on all tuples of the original stream. Neither tuple of the new streamObjects.equals(Object, Object)
any other.- Type Parameters:
GroupKey_
- the type of a fact in the destinationUniConstraintStream
's tuple- Parameters:
groupKeyMapping
- never null, mapping function to convert each element in the stream to a different element- Returns:
- never null
-
groupBy
<GroupKey_,ResultContainer_,Result_> BiConstraintStream<GroupKey_,Result_> groupBy(QuadFunction<A,B,C,D,GroupKey_> groupKeyMapping, QuadConstraintCollector<A,B,C,D,ResultContainer_,Result_> collector)
Convert theQuadConstraintStream
to aBiConstraintStream
, consisting of unique tuples.The first fact is the return value of the group key mapping function, applied on the incoming tuple. The second fact is the return value of a given
QuadConstraintCollector
applied on all incoming tuples with the same first fact.- Type Parameters:
GroupKey_
- the type of the first fact in the destinationBiConstraintStream
's tupleResultContainer_
- 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_,ResultB_,ResultContainerC_,ResultC_> TriConstraintStream<GroupKey_,ResultB_,ResultC_> groupBy(QuadFunction<A,B,C,D,GroupKey_> groupKeyMapping, QuadConstraintCollector<A,B,C,D,ResultContainerB_,ResultB_> collectorB, QuadConstraintCollector<A,B,C,D,ResultContainerC_,ResultC_> collectorC)
Convert theQuadConstraintStream
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
QuadConstraintCollector
applied on all incoming tuples with the same first fact.- Type Parameters:
GroupKey_
- 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:
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_,ResultB_,ResultContainerC_,ResultC_,ResultContainerD_,ResultD_> QuadConstraintStream<GroupKey_,ResultB_,ResultC_,ResultD_> groupBy(QuadFunction<A,B,C,D,GroupKey_> groupKeyMapping, QuadConstraintCollector<A,B,C,D,ResultContainerB_,ResultB_> collectorB, QuadConstraintCollector<A,B,C,D,ResultContainerC_,ResultC_> collectorC, QuadConstraintCollector<A,B,C,D,ResultContainerD_,ResultD_> collectorD)
Convert theQuadConstraintStream
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
QuadConstraintCollector
applied on all incoming tuples with the same first fact.- Type Parameters:
GroupKey_
- 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:
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(QuadFunction<A,B,C,D,GroupKeyA_> groupKeyAMapping, QuadFunction<A,B,C,D,GroupKeyB_> groupKeyBMapping)
Convert theQuadConstraintStream
to aBiConstraintStream
, consisting of unique tuples.The first fact is the return value of the first group key mapping function, applied on the incoming tuple. The second fact is the return value of the second group key mapping function, applied on all incoming tuples with the same first fact.
- Type Parameters:
GroupKeyA_
- the type of the first fact in the destinationBiConstraintStream
's tupleGroupKeyB_
- the type of the second fact in the destinationBiConstraintStream
's tuple- Parameters:
groupKeyAMapping
- never null, function to convert the facts in the original tuple to a new factgroupKeyBMapping
- never null, function to convert the facts in the original tuple to another new fact- Returns:
- never null
-
groupBy
<GroupKeyA_,GroupKeyB_,ResultContainer_,Result_> TriConstraintStream<GroupKeyA_,GroupKeyB_,Result_> groupBy(QuadFunction<A,B,C,D,GroupKeyA_> groupKeyAMapping, QuadFunction<A,B,C,D,GroupKeyB_> groupKeyBMapping, QuadConstraintCollector<A,B,C,D,ResultContainer_,Result_> collector)
Combines the semantics ofgroupBy(QuadFunction, QuadFunction)
andgroupBy(QuadConstraintCollector)
. That is, the first and second facts in the tuple follow thegroupBy(QuadFunction, QuadFunction)
semantics, and the third fact is the result of applyingQuadConstraintCollector.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 tupleGroupKeyB_
- the type of the second fact in the destinationTriConstraintStream
's tupleResultContainer_
- 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_,ResultContainerC_,ResultC_,ResultContainerD_,ResultD_> QuadConstraintStream<GroupKeyA_,GroupKeyB_,ResultC_,ResultD_> groupBy(QuadFunction<A,B,C,D,GroupKeyA_> groupKeyAMapping, QuadFunction<A,B,C,D,GroupKeyB_> groupKeyBMapping, QuadConstraintCollector<A,B,C,D,ResultContainerC_,ResultC_> collectorC, QuadConstraintCollector<A,B,C,D,ResultContainerD_,ResultD_> collectorD)
Combines the semantics ofgroupBy(QuadFunction, QuadFunction)
andgroupBy(QuadConstraintCollector)
. That is, the first and second facts in the tuple follow thegroupBy(QuadFunction, QuadFunction)
semantics. The third fact is the result of applying the firstQuadConstraintCollector.finisher()
on all the tuples of the originalQuadConstraintStream
that belong to the group. The fourth fact is the result of applying the secondQuadConstraintCollector.finisher()
on all the tuples of the originalQuadConstraintStream
that belong to the group- Type Parameters:
GroupKeyA_
- the type of the first fact in the destinationQuadConstraintStream
's tupleGroupKeyB_
- 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:
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_,GroupKeyC_> TriConstraintStream<GroupKeyA_,GroupKeyB_,GroupKeyC_> groupBy(QuadFunction<A,B,C,D,GroupKeyA_> groupKeyAMapping, QuadFunction<A,B,C,D,GroupKeyB_> groupKeyBMapping, QuadFunction<A,B,C,D,GroupKeyC_> groupKeyCMapping)
Convert theQuadConstraintStream
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 tupleGroupKeyB_
- the type of the second fact in the destinationTriConstraintStream
's tupleGroupKeyC_
- 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 factgroupKeyCMapping
- never null, function to convert the original tuple into a third fact- Returns:
- never null
-
groupBy
<GroupKeyA_,GroupKeyB_,GroupKeyC_,ResultContainerD_,ResultD_> QuadConstraintStream<GroupKeyA_,GroupKeyB_,GroupKeyC_,ResultD_> groupBy(QuadFunction<A,B,C,D,GroupKeyA_> groupKeyAMapping, QuadFunction<A,B,C,D,GroupKeyB_> groupKeyBMapping, QuadFunction<A,B,C,D,GroupKeyC_> groupKeyCMapping, QuadConstraintCollector<A,B,C,D,ResultContainerD_,ResultD_> collectorD)
Combines the semantics ofgroupBy(QuadFunction, QuadFunction)
andgroupBy(QuadConstraintCollector)
. That is, the first three facts in the tuple follow thegroupBy(QuadFunction, QuadFunction)
semantics. The final fact is the result of applying the firstQuadConstraintCollector.finisher()
on all the tuples of the originalQuadConstraintStream
that belong to the group.- Type Parameters:
GroupKeyA_
- the type of the first fact in the destinationQuadConstraintStream
's tupleGroupKeyB_
- the type of the second fact in the destinationQuadConstraintStream
's tupleGroupKeyC_
- 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 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_,GroupKeyC_,GroupKeyD_> QuadConstraintStream<GroupKeyA_,GroupKeyB_,GroupKeyC_,GroupKeyD_> groupBy(QuadFunction<A,B,C,D,GroupKeyA_> groupKeyAMapping, QuadFunction<A,B,C,D,GroupKeyB_> groupKeyBMapping, QuadFunction<A,B,C,D,GroupKeyC_> groupKeyCMapping, QuadFunction<A,B,C,D,GroupKeyD_> groupKeyDMapping)
Convert theTriConstraintStream
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 tupleGroupKeyB_
- the type of the second fact in the destinationQuadConstraintStream
's tupleGroupKeyC_
- the type of the third fact in the destinationQuadConstraintStream
's tupleGroupKeyD_
- 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 factgroupKeyDMapping
- never null, function to convert the original tuple into a fourth fact- Returns:
- never null
-
map
<ResultA_> UniConstraintStream<ResultA_> map(QuadFunction<A,B,C,D,ResultA_> mapping)
As defined byUniConstraintStream.map(Function)
.- Type Parameters:
ResultA_
- the type of the only fact in the resultingUniConstraintStream
's tuple- Parameters:
mapping
- never null, function to convert the original tuple into the new tuple- Returns:
- never null
-
flattenLast
<ResultD_> QuadConstraintStream<A,B,C,ResultD_> flattenLast(Function<D,Iterable<ResultD_>> mapping)
As defined byBiConstraintStream.flattenLast(Function)
.- Type Parameters:
ResultD_
- the type of the last fact in the resulting tuples- Parameters:
mapping
- never null, function to convert the last fact in the original tuple intoIterable
- Returns:
- never null
-
distinct
QuadConstraintStream<A,B,C,D> 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(QuadFunction)
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 Constraint penalize(String constraintName, Score<?> constraintWeight, ToIntQuadFunction<A,B,C,D> matchWeigher)
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, ToLongQuadFunction)
orpenalizeBigDecimal(String, Score, QuadFunction)
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
Constraint penalize(String constraintPackage, String constraintName, Score<?> constraintWeight, ToIntQuadFunction<A,B,C,D> matchWeigher)
As defined bypenalize(String, Score, ToIntQuadFunction)
.- Parameters:
constraintPackage
- never nullconstraintName
- never nullconstraintWeight
- never nullmatchWeigher
- never null- Returns:
- never null
-
penalizeLong
default Constraint penalizeLong(String constraintName, Score<?> constraintWeight, ToLongQuadFunction<A,B,C,D> matchWeigher)
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
Constraint penalizeLong(String constraintPackage, String constraintName, Score<?> constraintWeight, ToLongQuadFunction<A,B,C,D> matchWeigher)
As defined bypenalizeLong(String, Score, ToLongQuadFunction)
.- Parameters:
constraintPackage
- never nullconstraintName
- never nullconstraintWeight
- never nullmatchWeigher
- never null- Returns:
- never null
-
penalizeBigDecimal
default Constraint penalizeBigDecimal(String constraintName, Score<?> constraintWeight, QuadFunction<A,B,C,D,BigDecimal> matchWeigher)
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
Constraint penalizeBigDecimal(String constraintPackage, String constraintName, Score<?> constraintWeight, QuadFunction<A,B,C,D,BigDecimal> matchWeigher)
As defined bypenalizeBigDecimal(String, Score, QuadFunction)
.- Parameters:
constraintPackage
- never nullconstraintName
- never nullconstraintWeight
- never nullmatchWeigher
- never null- Returns:
- never null
-
penalizeConfigurable
default Constraint penalizeConfigurable(String constraintName, ToIntQuadFunction<A,B,C,D> matchWeigher)
Negatively impact theScore
: subtract theConstraintWeight
multiplied by the match weight. Otherwise as defined byConstraintStream.penalizeConfigurable(String)
.For non-int
Score
types usepenalizeConfigurableLong(String, ToLongQuadFunction)
orpenalizeConfigurableBigDecimal(String, QuadFunction)
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
Constraint penalizeConfigurable(String constraintPackage, String constraintName, ToIntQuadFunction<A,B,C,D> matchWeigher)
As defined bypenalizeConfigurable(String, ToIntQuadFunction)
.- Parameters:
constraintPackage
- never nullconstraintName
- never nullmatchWeigher
- never null- Returns:
- never null
-
penalizeConfigurableLong
default Constraint penalizeConfigurableLong(String constraintName, ToLongQuadFunction<A,B,C,D> matchWeigher)
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
Constraint penalizeConfigurableLong(String constraintPackage, String constraintName, ToLongQuadFunction<A,B,C,D> matchWeigher)
As defined bypenalizeConfigurableLong(String, ToLongQuadFunction)
.- Parameters:
constraintPackage
- never nullconstraintName
- never nullmatchWeigher
- never null- Returns:
- never null
-
penalizeConfigurableBigDecimal
default Constraint penalizeConfigurableBigDecimal(String constraintName, QuadFunction<A,B,C,D,BigDecimal> matchWeigher)
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
Constraint penalizeConfigurableBigDecimal(String constraintPackage, String constraintName, QuadFunction<A,B,C,D,BigDecimal> matchWeigher)
As defined bypenalizeConfigurableBigDecimal(String, QuadFunction)
.- Parameters:
constraintPackage
- never nullconstraintName
- never nullmatchWeigher
- never null- Returns:
- never null
-
reward
default Constraint reward(String constraintName, Score<?> constraintWeight, ToIntQuadFunction<A,B,C,D> matchWeigher)
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, ToLongQuadFunction)
orrewardBigDecimal(String, Score, QuadFunction)
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
Constraint reward(String constraintPackage, String constraintName, Score<?> constraintWeight, ToIntQuadFunction<A,B,C,D> matchWeigher)
As defined byreward(String, Score, ToIntQuadFunction)
.- Parameters:
constraintPackage
- never nullconstraintName
- never nullconstraintWeight
- never nullmatchWeigher
- never null- Returns:
- never null
-
rewardLong
default Constraint rewardLong(String constraintName, Score<?> constraintWeight, ToLongQuadFunction<A,B,C,D> matchWeigher)
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
Constraint rewardLong(String constraintPackage, String constraintName, Score<?> constraintWeight, ToLongQuadFunction<A,B,C,D> matchWeigher)
As defined byrewardLong(String, Score, ToLongQuadFunction)
.- Parameters:
constraintPackage
- never nullconstraintName
- never nullconstraintWeight
- never nullmatchWeigher
- never null- Returns:
- never null
-
rewardBigDecimal
default Constraint rewardBigDecimal(String constraintName, Score<?> constraintWeight, QuadFunction<A,B,C,D,BigDecimal> matchWeigher)
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
Constraint rewardBigDecimal(String constraintPackage, String constraintName, Score<?> constraintWeight, QuadFunction<A,B,C,D,BigDecimal> matchWeigher)
As defined byrewardBigDecimal(String, Score, QuadFunction)
.- Parameters:
constraintPackage
- never nullconstraintName
- never nullconstraintWeight
- never nullmatchWeigher
- never null- Returns:
- never null
-
rewardConfigurable
default Constraint rewardConfigurable(String constraintName, ToIntQuadFunction<A,B,C,D> matchWeigher)
Positively impact theScore
: add theConstraintWeight
multiplied by the match weight. Otherwise as defined byConstraintStream.rewardConfigurable(String)
.For non-int
Score
types userewardConfigurableLong(String, ToLongQuadFunction)
orrewardConfigurableBigDecimal(String, QuadFunction)
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
Constraint rewardConfigurable(String constraintPackage, String constraintName, ToIntQuadFunction<A,B,C,D> matchWeigher)
As defined byrewardConfigurable(String, ToIntQuadFunction)
.- Parameters:
constraintPackage
- never nullconstraintName
- never nullmatchWeigher
- never null- Returns:
- never null
-
rewardConfigurableLong
default Constraint rewardConfigurableLong(String constraintName, ToLongQuadFunction<A,B,C,D> matchWeigher)
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
Constraint rewardConfigurableLong(String constraintPackage, String constraintName, ToLongQuadFunction<A,B,C,D> matchWeigher)
As defined byrewardConfigurableLong(String, ToLongQuadFunction)
.- Parameters:
constraintPackage
- never nullconstraintName
- never nullmatchWeigher
- never null- Returns:
- never null
-
rewardConfigurableBigDecimal
default Constraint rewardConfigurableBigDecimal(String constraintName, QuadFunction<A,B,C,D,BigDecimal> matchWeigher)
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
Constraint rewardConfigurableBigDecimal(String constraintPackage, String constraintName, QuadFunction<A,B,C,D,BigDecimal> matchWeigher)
As defined byrewardConfigurableBigDecimal(String, QuadFunction)
.- Parameters:
constraintPackage
- never nullconstraintName
- never nullmatchWeigher
- never null- Returns:
- never null
-
impact
default Constraint impact(String constraintName, Score<?> constraintWeight, ToIntQuadFunction<A,B,C,D> matchWeigher)
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, ToLongQuadFunction)
orimpactBigDecimal(String, Score, QuadFunction)
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
Constraint impact(String constraintPackage, String constraintName, Score<?> constraintWeight, ToIntQuadFunction<A,B,C,D> matchWeigher)
As defined byimpact(String, Score, ToIntQuadFunction)
.- Parameters:
constraintPackage
- never nullconstraintName
- never nullconstraintWeight
- never nullmatchWeigher
- never null- Returns:
- never null
-
impactLong
default Constraint impactLong(String constraintName, Score<?> constraintWeight, ToLongQuadFunction<A,B,C,D> matchWeigher)
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
Constraint impactLong(String constraintPackage, String constraintName, Score<?> constraintWeight, ToLongQuadFunction<A,B,C,D> matchWeigher)
As defined byimpactLong(String, Score, ToLongQuadFunction)
.- Parameters:
constraintPackage
- never nullconstraintName
- never nullconstraintWeight
- never nullmatchWeigher
- never null- Returns:
- never null
-
impactBigDecimal
default Constraint impactBigDecimal(String constraintName, Score<?> constraintWeight, QuadFunction<A,B,C,D,BigDecimal> matchWeigher)
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
Constraint impactBigDecimal(String constraintPackage, String constraintName, Score<?> constraintWeight, QuadFunction<A,B,C,D,BigDecimal> matchWeigher)
As defined byimpactBigDecimal(String, Score, QuadFunction)
.- Parameters:
constraintPackage
- never nullconstraintName
- never nullconstraintWeight
- never nullmatchWeigher
- never null- Returns:
- never null
-
impactConfigurable
default Constraint impactConfigurable(String constraintName, ToIntQuadFunction<A,B,C,D> matchWeigher)
Positively or negatively impact theScore
by theConstraintWeight
for each match.Use
penalizeConfigurable(...)
orrewardConfigurable(...)
instead, unless this constraint can both have positive and negative weights.For non-int
Score
types useimpactConfigurableLong(String, ToLongQuadFunction)
orimpactConfigurableBigDecimal(String, QuadFunction)
instead.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
-
impactConfigurable
Constraint impactConfigurable(String constraintPackage, String constraintName, ToIntQuadFunction<A,B,C,D> matchWeigher)
As defined byimpactConfigurable(String, ToIntQuadFunction)
.- Parameters:
constraintPackage
- never nullconstraintName
- never nullmatchWeigher
- never null- Returns:
- never null
-
impactConfigurableLong
default Constraint impactConfigurableLong(String constraintName, ToLongQuadFunction<A,B,C,D> matchWeigher)
Positively or negatively impact theScore
by theConstraintWeight
for each match.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
Constraint impactConfigurableLong(String constraintPackage, String constraintName, ToLongQuadFunction<A,B,C,D> matchWeigher)
As defined byimpactConfigurableLong(String, ToLongQuadFunction)
.- Parameters:
constraintPackage
- never nullconstraintName
- never nullmatchWeigher
- never null- Returns:
- never null
-
impactConfigurableBigDecimal
default Constraint impactConfigurableBigDecimal(String constraintName, QuadFunction<A,B,C,D,BigDecimal> matchWeigher)
Positively or negatively impact theScore
by theConstraintWeight
for each match.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
Constraint impactConfigurableBigDecimal(String constraintPackage, String constraintName, QuadFunction<A,B,C,D,BigDecimal> matchWeigher)
As defined byimpactConfigurableBigDecimal(String, QuadFunction)
.- Parameters:
constraintPackage
- never nullconstraintName
- never nullmatchWeigher
- never null- Returns:
- never null
-
-