A
- the type of the first and only fact in the tuple.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)
Convert the
UniConstraintStream to a different UniConstraintStream , containing of the set of
tuples resulting from applying the group key mapping function on all tuples of the original stream. |
<GroupKey_,ResultContainer_,Result_> |
groupBy(Function<A,GroupKey_> groupKeyMapping,
UniConstraintCollector<A,ResultContainer_,Result_> collector)
Convert the
UniConstraintStream to a BiConstraintStream , consisting of tuples which have:
As the first fact, the value resulting from applying the group key mapping function on the fact from the
original tuple. |
<ResultContainer_,Result_> |
groupBy(UniConstraintCollector<A,ResultContainer_,Result_> collector)
Runs all tuples of the stream through a given @
UniConstraintCollector and converts them into a new
UniConstraintStream which only has a single tuple, the result of applying UniConstraintCollector . |
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<ResultContainer_,Result_> UniConstraintStream<Result_> groupBy(UniConstraintCollector<A,ResultContainer_,Result_> collector)
UniConstraintCollector
and converts them into a new
UniConstraintStream
which only has a single tuple, the result of applying UniConstraintCollector
.ResultContainer_
- the mutable accumulation type (often hidden as an implementation detail)Result_
- the type of a fact in the destination UniConstraintStream
's tuplecollector
- never null, the collector to perform the grouping operation with<GroupKey_> UniConstraintStream<GroupKey_> groupBy(Function<A,GroupKey_> groupKeyMapping)
UniConstraintStream
to a different UniConstraintStream
, containing of the set of
tuples resulting from applying the group key mapping function on all tuples of the original stream.
Neither tuple of the new stream will Objects.equals(Object, Object)
any other.GroupKey_
- the type of a fact in the destination UniConstraintStream
's tuplegroupKeyMapping
- never null, mapping function to convert each element in the stream to a different element<GroupKey_,ResultContainer_,Result_> BiConstraintStream<GroupKey_,Result_> groupBy(Function<A,GroupKey_> groupKeyMapping, UniConstraintCollector<A,ResultContainer_,Result_> collector)
UniConstraintStream
to a BiConstraintStream
, consisting of tuples which have:
Objects.equals(Object, Object)
any other.UniConstraintCollector
on all the facts of the
original tuple with a matching group key.GroupKey_
- the type of the first fact in the destination BiConstraintStream
's tupleResultContainer_
- the mutable accumulation type (often hidden as an implementation detail)Result_
- the type of the second fact in the destination BiConstraintStream
's tuplegroupKeyMapping
- never null, function to convert a fact in original tuple to a different factdefault 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.