A
- the type of the matched fact (either a problem fact or a planning entity
)public interface UniConstraintStream<A> extends ConstraintStream
ConstraintStream
that matches one fact.ConstraintStream
Modifier and Type | Method and Description |
---|---|
UniConstraintStream<A> |
filter(Predicate<A> predicate)
Exhaustively test each fact against the
Predicate
and match if Predicate.test(Object) returns true. |
<GroupKey_> |
groupBy(Function<A,GroupKey_> groupKeyMapping) |
<GroupKey_,ResultContainer_,Result_> |
groupBy(Function<A,GroupKey_> groupKeyMapping,
UniConstraintCollector<A,ResultContainer_,Result_> collector) |
<GroupKeyA_,GroupKeyB_> |
groupBy(Function<A,GroupKeyA_> groupKeyAMapping,
Function<A,GroupKeyB_> groupKeyBMapping) |
<GroupKeyA_,GroupKeyB_,ResultContainer_,Result_> |
groupBy(Function<A,GroupKeyA_> groupKeyAMapping,
Function<A,GroupKeyB_> groupKeyBMapping,
UniConstraintCollector<A,ResultContainer_,Result_> collector) |
<GroupKey_,ResultContainer_,Result_> |
groupBy(UniConstraintCollector<A,ResultContainer_,Result_> collector) |
default <B> BiConstraintStream<A,B> |
join(Class<B> otherClass)
Create a new
BiConstraintStream for every combination of A and B. |
default <B> BiConstraintStream<A,B> |
join(Class<B> otherClass,
BiJoiner<A,B>... joiners)
As defined by
join(Class, BiJoiner) . |
default <B> BiConstraintStream<A,B> |
join(Class<B> otherClass,
BiJoiner<A,B> joiner)
Create a new
BiConstraintStream for every combination of A and B
for which the BiJoiner is true (for the properties it extracts from both facts). |
default <B> BiConstraintStream<A,B> |
join(Class<B> otherClass,
BiJoiner<A,B> joiner1,
BiJoiner<A,B> joiner2)
As defined by
join(Class, BiJoiner) . |
default <B> BiConstraintStream<A,B> |
join(Class<B> otherClass,
BiJoiner<A,B> joiner1,
BiJoiner<A,B> joiner2,
BiJoiner<A,B> joiner3)
As defined by
join(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 by
join(Class, BiJoiner) . |
default <B> BiConstraintStream<A,B> |
join(UniConstraintStream<B> otherStream)
Create a new
BiConstraintStream for every combination of A and B. |
<B> BiConstraintStream<A,B> |
join(UniConstraintStream<B> otherStream,
BiJoiner<A,B> joiner)
Create a new
BiConstraintStream for every combination of A and B for which the BiJoiner
is true (for the properties it extracts from both facts). |
default Constraint |
penalize(String constraintName,
Score<?> constraintWeight,
ToIntFunction<A> matchWeigher)
Negatively impact the
Score : subtract the constraintWeight multiplied by the match weight. |
Constraint |
penalize(String constraintPackage,
String constraintName,
Score<?> constraintWeight,
ToIntFunction<A> matchWeigher)
As defined by
penalize(String, Score, ToIntFunction) . |
default Constraint |
penalizeBigDecimal(String constraintName,
Score<?> constraintWeight,
Function<A,BigDecimal> matchWeigher)
Negatively impact the
Score : subtract the constraintWeight multiplied by the match weight. |
Constraint |
penalizeBigDecimal(String constraintPackage,
String constraintName,
Score<?> constraintWeight,
Function<A,BigDecimal> matchWeigher)
As defined by
penalizeBigDecimal(String, Score, Function) . |
Constraint |
penalizeConfigurable(String constraintPackage,
String constraintName,
ToIntFunction<A> matchWeigher)
As defined by
penalizeConfigurable(String, ToIntFunction) . |
default Constraint |
penalizeConfigurable(String constraintName,
ToIntFunction<A> matchWeigher)
Negatively impact the
Score : subtract the ConstraintWeight multiplied by the match weight. |
default Constraint |
penalizeConfigurableBigDecimal(String constraintName,
Function<A,BigDecimal> matchWeigher)
Negatively impact the
Score : subtract the ConstraintWeight multiplied by the match weight. |
Constraint |
penalizeConfigurableBigDecimal(String constraintPackage,
String constraintName,
Function<A,BigDecimal> matchWeigher)
As defined by
penalizeConfigurableBigDecimal(String, Function) . |
Constraint |
penalizeConfigurableLong(String constraintPackage,
String constraintName,
ToLongFunction<A> matchWeigher)
As defined by
penalizeConfigurableLong(String, ToLongFunction) . |
default Constraint |
penalizeConfigurableLong(String constraintName,
ToLongFunction<A> matchWeigher)
Negatively impact the
Score : subtract the ConstraintWeight multiplied by the match weight. |
default Constraint |
penalizeLong(String constraintName,
Score<?> constraintWeight,
ToLongFunction<A> matchWeigher)
Negatively impact the
Score : subtract the constraintWeight multiplied by the match weight. |
Constraint |
penalizeLong(String constraintPackage,
String constraintName,
Score<?> constraintWeight,
ToLongFunction<A> matchWeigher)
As defined by
penalizeLong(String, Score, ToLongFunction) . |
default Constraint |
reward(String constraintName,
Score<?> constraintWeight,
ToIntFunction<A> matchWeigher)
Positively impact the
Score : add the constraintWeight multiplied by the match weight. |
Constraint |
reward(String constraintPackage,
String constraintName,
Score<?> constraintWeight,
ToIntFunction<A> matchWeigher)
As defined by
reward(String, Score, ToIntFunction) . |
default Constraint |
rewardBigDecimal(String constraintName,
Score<?> constraintWeight,
Function<A,BigDecimal> matchWeigher)
Positively impact the
Score : add the constraintWeight multiplied by the match weight. |
Constraint |
rewardBigDecimal(String constraintPackage,
String constraintName,
Score<?> constraintWeight,
Function<A,BigDecimal> matchWeigher)
As defined by
rewardBigDecimal(String, Score, Function) . |
Constraint |
rewardConfigurable(String constraintPackage,
String constraintName,
ToIntFunction<A> matchWeigher)
As defined by
rewardConfigurable(String, ToIntFunction) . |
default Constraint |
rewardConfigurable(String constraintName,
ToIntFunction<A> matchWeigher)
Positively impact the
Score : add the ConstraintWeight multiplied by the match weight. |
default Constraint |
rewardConfigurableBigDecimal(String constraintName,
Function<A,BigDecimal> matchWeigher)
Positively impact the
Score : add the ConstraintWeight multiplied by the match weight. |
Constraint |
rewardConfigurableBigDecimal(String constraintPackage,
String constraintName,
Function<A,BigDecimal> matchWeigher)
As defined by
rewardConfigurableBigDecimal(String, Function) . |
Constraint |
rewardConfigurableLong(String constraintPackage,
String constraintName,
ToLongFunction<A> matchWeigher)
As defined by
rewardConfigurableLong(String, ToLongFunction) . |
default Constraint |
rewardConfigurableLong(String constraintName,
ToLongFunction<A> matchWeigher)
Positively impact the
Score : add the ConstraintWeight multiplied by the match weight. |
default Constraint |
rewardLong(String constraintName,
Score<?> constraintWeight,
ToLongFunction<A> matchWeigher)
Positively impact the
Score : add the constraintWeight multiplied by the match weight. |
Constraint |
rewardLong(String constraintPackage,
String constraintName,
Score<?> constraintWeight,
ToLongFunction<A> matchWeigher)
As defined by
rewardLong(String, Score, ToLongFunction) . |
getConstraintFactory, penalize, penalize, penalizeConfigurable, penalizeConfigurable, reward, reward, rewardConfigurable, rewardConfigurable
UniConstraintStream<A> filter(Predicate<A> predicate)
Predicate
and match if Predicate.test(Object)
returns true.predicate
- never nulldefault <B> BiConstraintStream<A,B> join(UniConstraintStream<B> otherStream)
BiConstraintStream
for every combination of A and B.
Important: Filtering
this is slower and less scalable
than a join(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.
B
- the type of the second matched factotherStream
- never null<B> BiConstraintStream<A,B> join(UniConstraintStream<B> otherStream, BiJoiner<A,B> joiner)
BiConstraintStream
for every combination of A and B for which the BiJoiner
is true (for the properties it extracts from both facts).
Important: This is faster and more scalable than a join
followed by a filter
,
because it applies hashing and/or indexing on the properties,
so it doesn't create nor checks every combination of A and B.
B
- the type of the second matched factotherStream
- never nulljoiner
- never nullBiJoiner
is truedefault <B> BiConstraintStream<A,B> join(Class<B> otherClass)
BiConstraintStream
for every combination of A and B.
Important: Filtering
this is slower and less scalable
than a join(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.
This method is syntactic sugar for join(UniConstraintStream)
.
B
- the type of the second matched factotherClass
- never nulldefault <B> BiConstraintStream<A,B> join(Class<B> otherClass, BiJoiner<A,B> joiner)
BiConstraintStream
for every combination of A and B
for which the BiJoiner
is true (for the properties it extracts from both facts).
Important: This is faster and more scalable than a join
followed by a filter
,
because it applies hashing and/or indexing on the properties,
so it doesn't create nor checks every combination of A and B.
This method is syntactic sugar for join(UniConstraintStream, BiJoiner)
.
This method has overloaded methods with multiple BiJoiner
parameters.
B
- the type of the second matched factotherClass
- never nulljoiner
- never nullBiJoiner
is truedefault <B> BiConstraintStream<A,B> join(Class<B> otherClass, BiJoiner<A,B> joiner1, BiJoiner<A,B> joiner2)
join(Class, BiJoiner)
.B
- the type of the second matched factotherClass
- never nulljoiner1
- never nulljoiner2
- never nulljoiners
are truedefault <B> BiConstraintStream<A,B> join(Class<B> otherClass, BiJoiner<A,B> joiner1, BiJoiner<A,B> joiner2, BiJoiner<A,B> joiner3)
join(Class, BiJoiner)
.B
- the type of the second matched factotherClass
- never nulljoiner1
- never nulljoiner2
- never nulljoiner3
- never nulljoiners
are truedefault <B> BiConstraintStream<A,B> join(Class<B> otherClass, BiJoiner<A,B> joiner1, BiJoiner<A,B> joiner2, BiJoiner<A,B> joiner3, BiJoiner<A,B> joiner4)
join(Class, BiJoiner)
.B
- the type of the second matched factotherClass
- never nulljoiner1
- never nulljoiner2
- never nulljoiner3
- never nulljoiner4
- never nulljoiners
are truedefault <B> BiConstraintStream<A,B> join(Class<B> otherClass, BiJoiner<A,B>... joiners)
join(Class, BiJoiner)
.
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 4 BiJoiner
parameters.
B
- the type of the second matched factotherClass
- never nulljoiners
- never nulljoiners
are true<GroupKey_,ResultContainer_,Result_> UniConstraintStream<Result_> groupBy(UniConstraintCollector<A,ResultContainer_,Result_> collector)
<GroupKey_> UniConstraintStream<GroupKey_> groupBy(Function<A,GroupKey_> groupKeyMapping)
<GroupKey_,ResultContainer_,Result_> BiConstraintStream<GroupKey_,Result_> groupBy(Function<A,GroupKey_> groupKeyMapping, UniConstraintCollector<A,ResultContainer_,Result_> collector)
<GroupKeyA_,GroupKeyB_> BiConstraintStream<GroupKeyA_,GroupKeyB_> groupBy(Function<A,GroupKeyA_> groupKeyAMapping, Function<A,GroupKeyB_> groupKeyBMapping)
<GroupKeyA_,GroupKeyB_,ResultContainer_,Result_> TriConstraintStream<GroupKeyA_,GroupKeyB_,Result_> groupBy(Function<A,GroupKeyA_> groupKeyAMapping, Function<A,GroupKeyB_> groupKeyBMapping, UniConstraintCollector<A,ResultContainer_,Result_> collector)
default Constraint penalize(String constraintName, Score<?> constraintWeight, ToIntFunction<A> matchWeigher)
Score
: subtract the constraintWeight multiplied by the match weight.
Otherwise as defined by ConstraintStream.penalize(String, Score)
.
For non-int Score
types use penalizeLong(String, Score, ToLongFunction)
or penalizeBigDecimal(String, Score, Function)
instead.
constraintName
- never null, shows up in ConstraintMatchTotal
during score justificationconstraintWeight
- never nullmatchWeigher
- never null, the result of this function (matchWeight) is multiplied by the constraintWeightConstraint penalize(String constraintPackage, String constraintName, Score<?> constraintWeight, ToIntFunction<A> matchWeigher)
penalize(String, Score, ToIntFunction)
.constraintPackage
- never nullconstraintName
- never nullconstraintWeight
- never nullmatchWeigher
- never nulldefault Constraint penalizeLong(String constraintName, Score<?> constraintWeight, ToLongFunction<A> matchWeigher)
Score
: subtract the constraintWeight multiplied by the match weight.
Otherwise as defined by ConstraintStream.penalize(String, Score)
.constraintName
- never null, shows up in ConstraintMatchTotal
during score justificationconstraintWeight
- never nullmatchWeigher
- never null, the result of this function (matchWeight) is multiplied by the constraintWeightConstraint penalizeLong(String constraintPackage, String constraintName, Score<?> constraintWeight, ToLongFunction<A> matchWeigher)
penalizeLong(String, Score, ToLongFunction)
.constraintPackage
- never nullconstraintName
- never nullconstraintWeight
- never nullmatchWeigher
- never nulldefault Constraint penalizeBigDecimal(String constraintName, Score<?> constraintWeight, Function<A,BigDecimal> matchWeigher)
Score
: subtract the constraintWeight multiplied by the match weight.
Otherwise as defined by ConstraintStream.penalize(String, Score)
.constraintName
- never null, shows up in ConstraintMatchTotal
during score justificationconstraintWeight
- never nullmatchWeigher
- never null, the result of this function (matchWeight) is multiplied by the constraintWeightConstraint penalizeBigDecimal(String constraintPackage, String constraintName, Score<?> constraintWeight, Function<A,BigDecimal> matchWeigher)
penalizeBigDecimal(String, Score, Function)
.constraintPackage
- never nullconstraintName
- never nullconstraintWeight
- never nullmatchWeigher
- never nulldefault Constraint penalizeConfigurable(String constraintName, ToIntFunction<A> matchWeigher)
Score
: subtract the ConstraintWeight
multiplied by the match weight.
Otherwise as defined by ConstraintStream.penalizeConfigurable(String)
.
For non-int Score
types use penalizeConfigurableLong(String, ToLongFunction)
or penalizeConfigurableBigDecimal(String, Function)
instead.
constraintName
- never null, shows up in ConstraintMatchTotal
during score justificationmatchWeigher
- never null, the result of this function (matchWeight) is multiplied by the constraintWeightConstraint penalizeConfigurable(String constraintPackage, String constraintName, ToIntFunction<A> matchWeigher)
penalizeConfigurable(String, ToIntFunction)
.constraintPackage
- never nullconstraintName
- never nullmatchWeigher
- never nulldefault Constraint penalizeConfigurableLong(String constraintName, ToLongFunction<A> matchWeigher)
Score
: subtract the ConstraintWeight
multiplied by the match weight.
Otherwise as defined by ConstraintStream.penalizeConfigurable(String)
.constraintName
- never null, shows up in ConstraintMatchTotal
during score justificationmatchWeigher
- never null, the result of this function (matchWeight) is multiplied by the constraintWeightConstraint penalizeConfigurableLong(String constraintPackage, String constraintName, ToLongFunction<A> matchWeigher)
penalizeConfigurableLong(String, ToLongFunction)
.constraintPackage
- never nullconstraintName
- never nullmatchWeigher
- never nulldefault Constraint penalizeConfigurableBigDecimal(String constraintName, Function<A,BigDecimal> matchWeigher)
Score
: subtract the ConstraintWeight
multiplied by the match weight.
Otherwise as defined by ConstraintStream.penalizeConfigurable(String)
.constraintName
- never null, shows up in ConstraintMatchTotal
during score justificationmatchWeigher
- never null, the result of this function (matchWeight) is multiplied by the constraintWeightConstraint penalizeConfigurableBigDecimal(String constraintPackage, String constraintName, Function<A,BigDecimal> matchWeigher)
penalizeConfigurableBigDecimal(String, Function)
.constraintPackage
- never nullconstraintName
- never nullmatchWeigher
- never nulldefault Constraint reward(String constraintName, Score<?> constraintWeight, ToIntFunction<A> matchWeigher)
Score
: add the constraintWeight multiplied by the match weight.
Otherwise as defined by ConstraintStream.reward(String, Score)
.
For non-int Score
types use rewardLong(String, Score, ToLongFunction)
or rewardBigDecimal(String, Score, Function)
instead.
constraintName
- never null, shows up in ConstraintMatchTotal
during score justificationconstraintWeight
- never nullmatchWeigher
- never null, the result of this function (matchWeight) is multiplied by the constraintWeightConstraint reward(String constraintPackage, String constraintName, Score<?> constraintWeight, ToIntFunction<A> matchWeigher)
reward(String, Score, ToIntFunction)
.constraintPackage
- never nullconstraintName
- never nullmatchWeigher
- never nulldefault Constraint rewardLong(String constraintName, Score<?> constraintWeight, ToLongFunction<A> matchWeigher)
Score
: add the constraintWeight multiplied by the match weight.
Otherwise as defined by ConstraintStream.reward(String, Score)
.constraintName
- never null, shows up in ConstraintMatchTotal
during score justificationconstraintWeight
- never nullmatchWeigher
- never null, the result of this function (matchWeight) is multiplied by the constraintWeightConstraint rewardLong(String constraintPackage, String constraintName, Score<?> constraintWeight, ToLongFunction<A> matchWeigher)
rewardLong(String, Score, ToLongFunction)
.constraintPackage
- never nullconstraintName
- never nullmatchWeigher
- never nulldefault Constraint rewardBigDecimal(String constraintName, Score<?> constraintWeight, Function<A,BigDecimal> matchWeigher)
Score
: add the constraintWeight multiplied by the match weight.
Otherwise as defined by ConstraintStream.reward(String, Score)
.constraintName
- never null, shows up in ConstraintMatchTotal
during score justificationconstraintWeight
- never nullmatchWeigher
- never null, the result of this function (matchWeight) is multiplied by the constraintWeightConstraint rewardBigDecimal(String constraintPackage, String constraintName, Score<?> constraintWeight, Function<A,BigDecimal> matchWeigher)
rewardBigDecimal(String, Score, Function)
.constraintPackage
- never nullconstraintName
- never nullmatchWeigher
- never nulldefault Constraint rewardConfigurable(String constraintName, ToIntFunction<A> matchWeigher)
Score
: add the ConstraintWeight
multiplied by the match weight.
Otherwise as defined by ConstraintStream.rewardConfigurable(String)
.
For non-int Score
types use rewardConfigurableLong(String, ToLongFunction)
or rewardConfigurableBigDecimal(String, Function)
instead.
constraintName
- never null, shows up in ConstraintMatchTotal
during score justificationmatchWeigher
- never null, the result of this function (matchWeight) is multiplied by the constraintWeightConstraint rewardConfigurable(String constraintPackage, String constraintName, ToIntFunction<A> matchWeigher)
rewardConfigurable(String, ToIntFunction)
.constraintPackage
- never nullconstraintName
- never nullmatchWeigher
- never nulldefault Constraint rewardConfigurableLong(String constraintName, ToLongFunction<A> matchWeigher)
Score
: add the ConstraintWeight
multiplied by the match weight.
Otherwise as defined by ConstraintStream.rewardConfigurable(String)
.constraintName
- never null, shows up in ConstraintMatchTotal
during score justificationmatchWeigher
- never null, the result of this function (matchWeight) is multiplied by the constraintWeightConstraint rewardConfigurableLong(String constraintPackage, String constraintName, ToLongFunction<A> matchWeigher)
rewardConfigurableLong(String, ToLongFunction)
.constraintPackage
- never nullconstraintName
- never nullmatchWeigher
- never nulldefault Constraint rewardConfigurableBigDecimal(String constraintName, Function<A,BigDecimal> matchWeigher)
Score
: add the ConstraintWeight
multiplied by the match weight.
Otherwise as defined by ConstraintStream.rewardConfigurable(String)
.constraintName
- never null, shows up in ConstraintMatchTotal
during score justificationmatchWeigher
- never null, the result of this function (matchWeight) is multiplied by the constraintWeightConstraint rewardConfigurableBigDecimal(String constraintPackage, String constraintName, Function<A,BigDecimal> matchWeigher)
rewardConfigurableBigDecimal(String, Function)
.constraintPackage
- never nullconstraintName
- never nullmatchWeigher
- never nullCopyright © 2006–2019 JBoss by Red Hat. All rights reserved.