Interface UniConstraintStream<A>

    • Method Detail

      • join

        default <B> BiConstraintStream<A,​B> join​(UniConstraintStream<B> otherStream)
        Create a new 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.

        Type Parameters:
        B - the type of the second matched fact
        Parameters:
        otherStream - never null
        Returns:
        never null, a stream that matches every combination of A and B
      • join

        <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).

        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.

        Type Parameters:
        B - the type of the second matched fact
        Parameters:
        otherStream - never null
        joiner - never null
        Returns:
        never null, a stream that matches every combination of A and B for which the BiJoiner is true
      • join

        default <B> BiConstraintStream<A,​B> join​(Class<B> otherClass)
        Create a new 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).

        Type Parameters:
        B - the type of the second matched fact
        Parameters:
        otherClass - never null
        Returns:
        never null, a stream that matches every combination of A and B
      • join

        default <B> BiConstraintStream<A,​B> join​(Class<B> otherClass,
                                                       BiJoiner<A,​B> joiner)
        Create a new 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.

        Type Parameters:
        B - the type of the second matched fact
        Parameters:
        otherClass - never null
        joiner - never null
        Returns:
        never null, a stream that matches every combination of A and B for which the BiJoiner is true
      • join

        default <B> BiConstraintStream<A,​B> join​(Class<B> otherClass,
                                                       BiJoiner<A,​B> joiner1,
                                                       BiJoiner<A,​B> joiner2)
        As defined by join(Class, BiJoiner). For performance reasons, indexing joiners must be placed before filtering joiners.
        Type Parameters:
        B - the type of the second matched fact
        Parameters:
        otherClass - never null
        joiner1 - never null
        joiner2 - never null
        Returns:
        never null, a stream that matches every combination of A and B for which all the joiners are true
      • join

        default <B> BiConstraintStream<A,​B> join​(Class<B> otherClass,
                                                       BiJoiner<A,​B> joiner1,
                                                       BiJoiner<A,​B> joiner2,
                                                       BiJoiner<A,​B> joiner3)
        As defined by join(Class, BiJoiner). For performance reasons, indexing joiners must be placed before filtering joiners.
        Type Parameters:
        B - the type of the second matched fact
        Parameters:
        otherClass - never null
        joiner1 - never null
        joiner2 - never null
        joiner3 - never null
        Returns:
        never null, a stream that matches every combination of A and B for which all the joiners are true
      • join

        default <B> BiConstraintStream<A,​B> join​(Class<B> otherClass,
                                                       BiJoiner<A,​B> joiner1,
                                                       BiJoiner<A,​B> joiner2,
                                                       BiJoiner<A,​B> joiner3,
                                                       BiJoiner<A,​B> joiner4)
        As defined by join(Class, BiJoiner). For performance reasons, indexing joiners must be placed before filtering joiners.
        Type Parameters:
        B - the type of the second matched fact
        Parameters:
        otherClass - never null
        joiner1 - never null
        joiner2 - never null
        joiner3 - never null
        joiner4 - never null
        Returns:
        never null, a stream that matches every combination of A and B for which all the joiners are true
      • join

        default <B> BiConstraintStream<A,​B> join​(Class<B> otherClass,
                                                       BiJoiner<A,​B>... joiners)
        As defined by join(Class, BiJoiner). If multiple BiJoiners are provided, for performance reasons, the indexing joiners must be placed before filtering joiners.

        This method causes Unchecked generics array creation for varargs parameter warnings, but we can't fix it with a SafeVarargs annotation because it's an interface method. Therefore, there are overloaded methods with up to 4 BiJoiner parameters.

        Type Parameters:
        B - the type of the second matched fact
        Parameters:
        otherClass - never null
        joiners - never null
        Returns:
        never null, a stream that matches every combination of A and B for which all the joiners are true
      • ifExists

        default <B> UniConstraintStream<A> ifExists​(Class<B> otherClass,
                                                    BiJoiner<A,​B> joiner)
        Create a new UniConstraintStream for every A where B exists for which the BiJoiner is true (for the properties it extracts from both facts).

        This method has overloaded methods with multiple BiJoiner parameters.

        Type Parameters:
        B - the type of the second matched fact
        Parameters:
        otherClass - never null
        joiner - never null
        Returns:
        never null, a stream that matches every A where B exists for which the BiJoiner is true
      • ifExists

        default <B> UniConstraintStream<A> ifExists​(Class<B> otherClass,
                                                    BiJoiner<A,​B> joiner1,
                                                    BiJoiner<A,​B> joiner2)
        As defined by ifExists(Class, BiJoiner). For performance reasons, indexing joiners must be placed before filtering joiners.
        Type Parameters:
        B - the type of the second matched fact
        Parameters:
        otherClass - never null
        joiner1 - never null
        joiner2 - never null
        Returns:
        never null, a stream that matches every A where B exists for which all the BiJoiners are true
      • ifExists

        default <B> UniConstraintStream<A> ifExists​(Class<B> otherClass,
                                                    BiJoiner<A,​B> joiner1,
                                                    BiJoiner<A,​B> joiner2,
                                                    BiJoiner<A,​B> joiner3)
        As defined by ifExists(Class, BiJoiner). For performance reasons, indexing joiners must be placed before filtering joiners.
        Type Parameters:
        B - the type of the second matched fact
        Parameters:
        otherClass - never null
        joiner1 - never null
        joiner2 - never null
        joiner3 - never null
        Returns:
        never null, a stream that matches every A where B exists for which all the BiJoiners are true
      • ifExists

        default <B> UniConstraintStream<A> ifExists​(Class<B> otherClass,
                                                    BiJoiner<A,​B> joiner1,
                                                    BiJoiner<A,​B> joiner2,
                                                    BiJoiner<A,​B> joiner3,
                                                    BiJoiner<A,​B> joiner4)
        As defined by ifExists(Class, BiJoiner). For performance reasons, indexing joiners must be placed before filtering joiners.
        Type Parameters:
        B - the type of the second matched fact
        Parameters:
        otherClass - never null
        joiner1 - never null
        joiner2 - never null
        joiner3 - never null
        joiner4 - never null
        Returns:
        never null, a stream that matches every A where B exists for which all the BiJoiners are true
      • ifExists

        <B> UniConstraintStream<A> ifExists​(Class<B> otherClass,
                                            BiJoiner<A,​B>... joiners)
        As defined by ifExists(Class, BiJoiner). For performance reasons, indexing joiners must be placed before filtering joiners.

        This method causes Unchecked generics array creation for varargs parameter warnings, but we can't fix it with a SafeVarargs annotation because it's an interface method. Therefore, there are overloaded methods with up to 4 BiJoiner parameters.

        Type Parameters:
        B - the type of the second matched fact
        Parameters:
        otherClass - never null
        joiners - never null
        Returns:
        never null, a stream that matches every A where B exists for which all the BiJoiners are true
      • ifExistsOther

        default UniConstraintStream<A> ifExistsOther​(Class<A> otherClass,
                                                     BiJoiner<A,​A> joiner)
        Create a new UniConstraintStream for every A, if another A exists that does not Object.equals(Object) the first, and for which the BiJoiner is true (for the properties it extracts from both facts).

        This method has overloaded methods with multiple BiJoiner parameters.

        Parameters:
        otherClass - never null
        joiner - never null
        Returns:
        never null, a stream that matches every A where a different A exists for which the BiJoiner is true
      • ifExistsOther

        default UniConstraintStream<A> ifExistsOther​(Class<A> otherClass,
                                                     BiJoiner<A,​A> joiner1,
                                                     BiJoiner<A,​A> joiner2)
        As defined by ifExistsOther(Class, BiJoiner). For performance reasons, indexing joiners must be placed before filtering joiners.
        Parameters:
        otherClass - never null
        joiner1 - never null
        joiner2 - never null
        Returns:
        never null, a stream that matches every A where a different A exists for which all the BiJoiners are true
      • ifExistsOther

        default UniConstraintStream<A> ifExistsOther​(Class<A> otherClass,
                                                     BiJoiner<A,​A> joiner1,
                                                     BiJoiner<A,​A> joiner2,
                                                     BiJoiner<A,​A> joiner3)
        As defined by ifExistsOther(Class, BiJoiner). For performance reasons, indexing joiners must be placed before filtering joiners.
        Parameters:
        otherClass - never null
        joiner1 - never null
        joiner2 - never null
        joiner3 - never null
        Returns:
        never null, a stream that matches every A where a different A exists for which all the BiJoiners are true
      • ifExistsOther

        default UniConstraintStream<A> ifExistsOther​(Class<A> otherClass,
                                                     BiJoiner<A,​A> joiner1,
                                                     BiJoiner<A,​A> joiner2,
                                                     BiJoiner<A,​A> joiner3,
                                                     BiJoiner<A,​A> joiner4)
        As defined by ifExistsOther(Class, BiJoiner). For performance reasons, indexing joiners must be placed before filtering joiners.
        Parameters:
        otherClass - never null
        joiner1 - never null
        joiner2 - never null
        joiner3 - never null
        joiner4 - never null
        Returns:
        never null, a stream that matches every A where a different A exists for which all the BiJoiners are true
      • ifExistsOther

        default UniConstraintStream<A> ifExistsOther​(Class<A> otherClass,
                                                     BiJoiner<A,​A>... joiners)
        As defined by ifExistsOther(Class, BiJoiner). If multiple BiJoiners are provided, for performance reasons, the indexing joiners must be placed before filtering joiners.

        This method causes Unchecked generics array creation for varargs parameter warnings, but we can't fix it with a SafeVarargs annotation because it's an interface method. Therefore, there are overloaded methods with up to 4 BiJoiner parameters.

        Parameters:
        otherClass - never null
        joiners - never null
        Returns:
        never null, a stream that matches every A where a different A exists for which all the BiJoiners are true
      • ifNotExists

        default <B> UniConstraintStream<A> ifNotExists​(Class<B> otherClass,
                                                       BiJoiner<A,​B> joiner)
        Create a new UniConstraintStream for every A where B does not exist for which the BiJoiner is true (for the properties it extracts from both facts).

        This method has overloaded methods with multiple BiJoiner parameters.

        Type Parameters:
        B - the type of the second matched fact
        Parameters:
        otherClass - never null
        joiner - never null
        Returns:
        never null, a stream that matches every A where B does not exist for which the BiJoiner is true
      • ifNotExists

        default <B> UniConstraintStream<A> ifNotExists​(Class<B> otherClass,
                                                       BiJoiner<A,​B> joiner1,
                                                       BiJoiner<A,​B> joiner2)
        As defined by ifNotExists(Class, BiJoiner). For performance reasons, indexing joiners must be placed before filtering joiners.
        Type Parameters:
        B - the type of the second matched fact
        Parameters:
        otherClass - never null
        joiner1 - never null
        joiner2 - never null
        Returns:
        never null, a stream that matches every A where B does not exist for which all the BiJoiners are true
      • ifNotExists

        default <B> UniConstraintStream<A> ifNotExists​(Class<B> otherClass,
                                                       BiJoiner<A,​B> joiner1,
                                                       BiJoiner<A,​B> joiner2,
                                                       BiJoiner<A,​B> joiner3)
        As defined by ifNotExists(Class, BiJoiner). For performance reasons, indexing joiners must be placed before filtering joiners.
        Type Parameters:
        B - the type of the second matched fact
        Parameters:
        otherClass - never null
        joiner1 - never null
        joiner2 - never null
        joiner3 - never null
        Returns:
        never null, a stream that matches every A where B does not exist for which all the BiJoiners are true
      • ifNotExists

        default <B> UniConstraintStream<A> ifNotExists​(Class<B> otherClass,
                                                       BiJoiner<A,​B> joiner1,
                                                       BiJoiner<A,​B> joiner2,
                                                       BiJoiner<A,​B> joiner3,
                                                       BiJoiner<A,​B> joiner4)
        As defined by ifNotExists(Class, BiJoiner). For performance reasons, indexing joiners must be placed before filtering joiners.
        Type Parameters:
        B - the type of the second matched fact
        Parameters:
        otherClass - never null
        joiner1 - never null
        joiner2 - never null
        joiner3 - never null
        joiner4 - never null
        Returns:
        never null, a stream that matches every A where B does not exist for which all the BiJoiners are true
      • ifNotExists

        <B> UniConstraintStream<A> ifNotExists​(Class<B> otherClass,
                                               BiJoiner<A,​B>... joiners)
        As defined by ifNotExists(Class, BiJoiner). For performance reasons, indexing joiners must be placed before filtering joiners.

        This method causes Unchecked generics array creation for varargs parameter warnings, but we can't fix it with a SafeVarargs annotation because it's an interface method. Therefore, there are overloaded methods with up to 4 BiJoiner parameters.

        Type Parameters:
        B - the type of the second matched fact
        Parameters:
        otherClass - never null
        joiners - never null
        Returns:
        never null, a stream that matches every A where B does not exist for which all the BiJoiners are true
      • ifNotExistsOther

        default UniConstraintStream<A> ifNotExistsOther​(Class<A> otherClass,
                                                        BiJoiner<A,​A> joiner)
        Create a new UniConstraintStream for every A, if no other A exists that does not Object.equals(Object) the first, and for which the BiJoiner is true (for the properties it extracts from both facts).

        This method has overloaded methods with multiple BiJoiner parameters.

        Parameters:
        otherClass - never null
        joiner - never null
        Returns:
        never null, a stream that matches every A where a different A does not exist for which the BiJoiner is true
      • ifNotExistsOther

        default UniConstraintStream<A> ifNotExistsOther​(Class<A> otherClass,
                                                        BiJoiner<A,​A> joiner1,
                                                        BiJoiner<A,​A> joiner2)
        As defined by ifNotExistsOther(Class, BiJoiner). For performance reasons, indexing joiners must be placed before filtering joiners.
        Parameters:
        otherClass - never null
        joiner1 - never null
        joiner2 - never null
        Returns:
        never null, a stream that matches every A where a different A does not exist for which all the BiJoiners are true
      • ifNotExistsOther

        default UniConstraintStream<A> ifNotExistsOther​(Class<A> otherClass,
                                                        BiJoiner<A,​A> joiner1,
                                                        BiJoiner<A,​A> joiner2,
                                                        BiJoiner<A,​A> joiner3)
        As defined by ifNotExistsOther(Class, BiJoiner). For performance reasons, indexing joiners must be placed before filtering joiners.
        Parameters:
        otherClass - never null
        joiner1 - never null
        joiner2 - never null
        joiner3 - never null
        Returns:
        never null, a stream that matches every A where a different A does not exist for which all the BiJoiners are true
      • ifNotExistsOther

        default UniConstraintStream<A> ifNotExistsOther​(Class<A> otherClass,
                                                        BiJoiner<A,​A> joiner1,
                                                        BiJoiner<A,​A> joiner2,
                                                        BiJoiner<A,​A> joiner3,
                                                        BiJoiner<A,​A> joiner4)
        As defined by ifNotExistsOther(Class, BiJoiner). For performance reasons, indexing joiners must be placed before filtering joiners.
        Parameters:
        otherClass - never null
        joiner1 - never null
        joiner2 - never null
        joiner3 - never null
        joiner4 - never null
        Returns:
        never null, a stream that matches every A where a different A does not exist for which all the BiJoiners are true
      • ifNotExistsOther

        default UniConstraintStream<A> ifNotExistsOther​(Class<A> otherClass,
                                                        BiJoiner<A,​A>... joiners)
        As defined by ifNotExistsOther(Class, BiJoiner). If multiple BiJoiners are provided, for performance reasons, the indexing joiners must be placed before filtering joiners.

        This method causes Unchecked generics array creation for varargs parameter warnings, but we can't fix it with a SafeVarargs annotation because it's an interface method. Therefore, there are overloaded methods with up to 4 BiJoiner parameters.

        Parameters:
        otherClass - never null
        joiners - never null
        Returns:
        never null, a stream that matches every A where a different A does not exist for which all the BiJoiners are true
      • groupBy

        <GroupKey_> UniConstraintStream<GroupKey_> groupBy​(Function<A,​GroupKey_> groupKeyMapping)
        Convert the UniConstraintStream to a different UniConstraintStream, 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 stream Objects.equals(Object, Object) any other.
        Type Parameters:
        GroupKey_ - the type of a fact in the destination UniConstraintStream'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​(Function<A,​GroupKey_> groupKeyMapping,
                                                                                                             UniConstraintCollector<A,​ResultContainer_,​Result_> collector)
        Convert the UniConstraintStream to a BiConstraintStream, consisting of unique tuples with two facts.

        The first fact is the return value of the first group key mapping function, applied on the incoming tuple. The second fact is the return value of a given UniConstraintCollector applied on all incoming tuples with the same first fact.

        Type Parameters:
        GroupKey_ - the type of the first fact in the destination BiConstraintStream's tuple
        ResultContainer_ - the mutable accumulation type (often hidden as an implementation detail)
        Result_ - the type of the second fact in the destination BiConstraintStream's tuple
        Parameters:
        groupKeyMapping - never null, function to convert the fact in the original tuple to a different fact
        collector - never null, the collector to perform the grouping operation with See ConstraintCollectors for common operations, such as count(), sum() and others.
        Returns:
        never null
      • groupBy

        <GroupKeyA_,​GroupKeyB_> BiConstraintStream<GroupKeyA_,​GroupKeyB_> groupBy​(Function<A,​GroupKeyA_> groupKeyAMapping,
                                                                                              Function<A,​GroupKeyB_> groupKeyBMapping)
        Convert the UniConstraintStream to a BiConstraintStream, consisting of unique tuples with two facts.

        The first fact is the return value of the first group key mapping function, applied on the incoming tuple. The second fact is the return value of the second group key mapping function, applied on all incoming tuples with the same first fact.

        Type Parameters:
        GroupKeyA_ - the type of the first fact in the destination BiConstraintStream's tuple
        GroupKeyB_ - the type of the second fact in the destination BiConstraintStream's tuple
        Parameters:
        groupKeyAMapping - never null, function to convert the original tuple into a first fact
        groupKeyBMapping - never null, function to convert the original tuple into a second fact
        Returns:
        never null
      • groupBy

        <GroupKeyA_,​GroupKeyB_,​ResultContainer_,​Result_> TriConstraintStream<GroupKeyA_,​GroupKeyB_,​Result_> groupBy​(Function<A,​GroupKeyA_> groupKeyAMapping,
                                                                                                                                                  Function<A,​GroupKeyB_> groupKeyBMapping,
                                                                                                                                                  UniConstraintCollector<A,​ResultContainer_,​Result_> collector)
        Combines the semantics of groupBy(Function, Function) and groupBy(UniConstraintCollector). That is, the first and second facts in the tuple follow the groupBy(Function, Function) semantics, and the third fact is the result of applying UniConstraintCollector.finisher() on all the tuples of the original UniConstraintStream that belong to the group.
        Type Parameters:
        GroupKeyA_ - the type of the first fact in the destination TriConstraintStream's tuple
        GroupKeyB_ - the type of the second fact in the destination TriConstraintStream's tuple
        ResultContainer_ - the mutable accumulation type (often hidden as an implementation detail)
        Result_ - the type of the third fact in the destination TriConstraintStream's tuple
        Parameters:
        groupKeyAMapping - never null, function to convert the original tuple into a first fact
        groupKeyBMapping - never null, function to convert the original tuple into a second fact
        collector - never null, the collector to perform the grouping operation with See ConstraintCollectors for common operations, such as count(), sum() and others.
        Returns:
        never null
      • groupBy

        <GroupKeyA_,​GroupKeyB_,​ResultContainerC_,​ResultC_,​ResultContainerD_,​ResultD_> QuadConstraintStream<GroupKeyA_,​GroupKeyB_,​ResultC_,​ResultD_> groupBy​(Function<A,​GroupKeyA_> groupKeyAMapping,
                                                                                                                                                                                                            Function<A,​GroupKeyB_> groupKeyBMapping,
                                                                                                                                                                                                            UniConstraintCollector<A,​ResultContainerC_,​ResultC_> collectorC,
                                                                                                                                                                                                            UniConstraintCollector<A,​ResultContainerD_,​ResultD_> collectorD)
        Combines the semantics of groupBy(Function, Function) and groupBy(UniConstraintCollector). That is, the first and second facts in the tuple follow the groupBy(Function, Function) semantics. The third fact is the result of applying the first UniConstraintCollector.finisher() on all the tuples of the original UniConstraintStream that belong to the group. The fourth fact is the result of applying the second UniConstraintCollector.finisher() on all the tuples of the original UniConstraintStream that belong to the group
        Type Parameters:
        GroupKeyA_ - the type of the first fact in the destination QuadConstraintStream's tuple
        GroupKeyB_ - the type of the second fact in the destination QuadConstraintStream's tuple
        ResultContainerC_ - the mutable accumulation type (often hidden as an implementation detail)
        ResultC_ - the type of the third fact in the destination QuadConstraintStream's tuple
        ResultContainerD_ - the mutable accumulation type (often hidden as an implementation detail)
        ResultD_ - the type of the fourth fact in the destination QuadConstraintStream's tuple
        Parameters:
        groupKeyAMapping - never null, function to convert the original tuple into a first fact
        groupKeyBMapping - never null, function to convert the original tuple into a second fact
        collectorC - never null, the collector to perform the first grouping operation with See ConstraintCollectors for common operations, such as count(), sum() and others.
        collectorD - never null, the collector to perform the second grouping operation with See ConstraintCollectors for common operations, such as count(), sum() and others.
        Returns:
        never null
      • penalizeLong

        default Constraint penalizeLong​(String constraintName,
                                        Score<?> constraintWeight,
                                        ToLongFunction<A> matchWeigher)
        Negatively impact the Score: subtract the constraintWeight multiplied by the match weight. Otherwise as defined by ConstraintStream.penalize(String, Score).
        Parameters:
        constraintName - never null, shows up in ConstraintMatchTotal during score justification
        constraintWeight - never null
        matchWeigher - never null, the result of this function (matchWeight) is multiplied by the constraintWeight
        Returns:
        never null
      • penalizeBigDecimal

        default Constraint penalizeBigDecimal​(String constraintName,
                                              Score<?> constraintWeight,
                                              Function<A,​BigDecimal> matchWeigher)
        Negatively impact the Score: subtract the constraintWeight multiplied by the match weight. Otherwise as defined by ConstraintStream.penalize(String, Score).
        Parameters:
        constraintName - never null, shows up in ConstraintMatchTotal during score justification
        constraintWeight - never null
        matchWeigher - never null, the result of this function (matchWeight) is multiplied by the constraintWeight
        Returns:
        never null
      • rewardLong

        default Constraint rewardLong​(String constraintName,
                                      Score<?> constraintWeight,
                                      ToLongFunction<A> matchWeigher)
        Positively impact the Score: add the constraintWeight multiplied by the match weight. Otherwise as defined by ConstraintStream.reward(String, Score).
        Parameters:
        constraintName - never null, shows up in ConstraintMatchTotal during score justification
        constraintWeight - never null
        matchWeigher - never null, the result of this function (matchWeight) is multiplied by the constraintWeight
        Returns:
        never null
      • rewardBigDecimal

        default Constraint rewardBigDecimal​(String constraintName,
                                            Score<?> constraintWeight,
                                            Function<A,​BigDecimal> matchWeigher)
        Positively impact the Score: add the constraintWeight multiplied by the match weight. Otherwise as defined by ConstraintStream.reward(String, Score).
        Parameters:
        constraintName - never null, shows up in ConstraintMatchTotal during score justification
        constraintWeight - never null
        matchWeigher - never null, the result of this function (matchWeight) is multiplied by the constraintWeight
        Returns:
        never null
      • impactLong

        default Constraint impactLong​(String constraintName,
                                      Score<?> constraintWeight,
                                      ToLongFunction<A> matchWeigher)
        Positively or negatively impact the Score by the constraintWeight multiplied by the match weight. Otherwise as defined by ConstraintStream.impact(String, Score).

        Use penalizeLong(...) or rewardLong(...) instead, unless this constraint can both have positive and negative weights.

        Parameters:
        constraintName - never null, shows up in ConstraintMatchTotal during score justification
        constraintWeight - never null
        matchWeigher - never null, the result of this function (matchWeight) is multiplied by the constraintWeight
        Returns:
        never null
      • impactBigDecimal

        default Constraint impactBigDecimal​(String constraintName,
                                            Score<?> constraintWeight,
                                            Function<A,​BigDecimal> matchWeigher)
        Positively or negatively impact the Score by the constraintWeight multiplied by the match weight. Otherwise as defined by ConstraintStream.impact(String, Score).

        Use penalizeBigDecimal(...) or rewardBigDecimal(...) instead, unless this constraint can both have positive and negative weights.

        Parameters:
        constraintName - never null, shows up in ConstraintMatchTotal during score justification
        constraintWeight - never null
        matchWeigher - never null, the result of this function (matchWeight) is multiplied by the constraintWeight
        Returns:
        never null