Interface TriConstraintStream<A,​B,​C>

    • Method Detail

      • join

        default <D> QuadConstraintStream<A,​B,​C,​D> join​(UniConstraintStream<D> otherStream)
        Create a new QuadConstraintStream for every combination of [A, B, C] and D.

        Important: Filtering this is slower and less scalable than a join(UniConstraintStream, QuadJoiner), because it doesn't apply hashing and/or indexing on the properties, so it creates and checks every combination of [A, B] and C.

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

        <D> QuadConstraintStream<A,​B,​C,​D> join​(UniConstraintStream<D> otherStream,
                                                                 QuadJoiner<A,​B,​C,​D> joiner)
        Create a new QuadConstraintStream for every combination of [A, B] and C for which the QuadJoiner is true (for the properties it extracts from all 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, B, C] and D.

        Type Parameters:
        D - the type of the fourth matched fact
        Parameters:
        otherStream - never null
        joiner - never null
        Returns:
        never null, a stream that matches every combination of [A, B, C] and D for which the QuadJoiner is true
      • join

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

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

        default <D> QuadConstraintStream<A,​B,​C,​D> join​(UniConstraintStream<D> otherStream,
                                                                         QuadJoiner<A,​B,​C,​D> joiner1,
                                                                         QuadJoiner<A,​B,​C,​D> joiner2,
                                                                         QuadJoiner<A,​B,​C,​D> joiner3,
                                                                         QuadJoiner<A,​B,​C,​D> joiner4)
        As defined by join(Class, QuadJoiner). For performance reasons, indexing joiners must be placed before filtering joiners.
        Type Parameters:
        D - the type of the fourth matched fact
        Parameters:
        otherStream - 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, B, C] and D for which all the joiners are true
      • join

        default <D> QuadConstraintStream<A,​B,​C,​D> join​(UniConstraintStream<D> otherStream,
                                                                         QuadJoiner<A,​B,​C,​D>... joiners)
        As defined by join(Class, QuadJoiner). 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 QuadJoiner parameters.

        Type Parameters:
        D - the type of the fourth matched fact
        Parameters:
        otherStream - never null
        joiners - never null
        Returns:
        never null, a stream that matches every combination of [A, B, C] and D for which all the joiners are true
      • join

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

        default <D> QuadConstraintStream<A,​B,​C,​D> join​(Class<D> otherClass,
                                                                         QuadJoiner<A,​B,​C,​D> joiner1,
                                                                         QuadJoiner<A,​B,​C,​D> joiner2,
                                                                         QuadJoiner<A,​B,​C,​D> joiner3)
        As defined by join(Class, QuadJoiner). For performance reasons, indexing joiners must be placed before filtering joiners.
        Type Parameters:
        D - the type of the fourth 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, B, C] and D for which all the joiners are true
      • join

        default <D> QuadConstraintStream<A,​B,​C,​D> join​(Class<D> otherClass,
                                                                         QuadJoiner<A,​B,​C,​D> joiner1,
                                                                         QuadJoiner<A,​B,​C,​D> joiner2,
                                                                         QuadJoiner<A,​B,​C,​D> joiner3,
                                                                         QuadJoiner<A,​B,​C,​D> joiner4)
        As defined by join(Class, QuadJoiner). For performance reasons, indexing joiners must be placed before filtering joiners.
        Type Parameters:
        D - the type of the fourth 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, B, C] and D for which all the joiners are true
      • join

        <D> QuadConstraintStream<A,​B,​C,​D> join​(Class<D> otherClass,
                                                                 QuadJoiner<A,​B,​C,​D>... joiners)
        As defined by join(Class, QuadJoiner). 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 QuadJoiner parameters.

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

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

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

        default <D> TriConstraintStream<A,​B,​C> ifExists​(Class<D> otherClass,
                                                                    QuadJoiner<A,​B,​C,​D> joiner1,
                                                                    QuadJoiner<A,​B,​C,​D> joiner2,
                                                                    QuadJoiner<A,​B,​C,​D> joiner3,
                                                                    QuadJoiner<A,​B,​C,​D> joiner4)
        As defined by ifExists(Class, QuadJoiner). For performance reasons, indexing joiners must be placed before filtering joiners.
        Type Parameters:
        D - the type of the fourth 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 tuple of A, B and C where D exists for which the QuadJoiners are true
      • ifExists

        <D> TriConstraintStream<A,​B,​C> ifExists​(Class<D> otherClass,
                                                            QuadJoiner<A,​B,​C,​D>... joiners)
        As defined by ifExists(Class, QuadJoiner). 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 QuadJoiner parameters.

        Type Parameters:
        D - the type of the fourth matched fact
        Parameters:
        otherClass - never null
        joiners - never null
        Returns:
        never null, a stream that matches every tuple of A, B and C where D exists for which the QuadJoiners are true
      • ifExistsIncludingNullVars

        default <D> TriConstraintStream<A,​B,​C> ifExistsIncludingNullVars​(Class<D> otherClass,
                                                                                     QuadJoiner<A,​B,​C,​D> joiner)
        Create a new BiConstraintStream for every tuple of A, B and C where D exists for which the QuadJoiner is true (for the properties it extracts from the facts). For classes annotated with PlanningEntity, this method also includes instances with null variables.

        This method has overloaded methods with multiple QuadJoiner parameters.

        Type Parameters:
        D - the type of the fourth matched fact
        Parameters:
        otherClass - never null
        joiner - never null
        Returns:
        never null, a stream that matches every tuple of A, B and C where D exists for which the QuadJoiner is true
      • ifExistsIncludingNullVars

        default <D> TriConstraintStream<A,​B,​C> ifExistsIncludingNullVars​(Class<D> otherClass,
                                                                                     QuadJoiner<A,​B,​C,​D> joiner1,
                                                                                     QuadJoiner<A,​B,​C,​D> joiner2)
        As defined by ifExistsIncludingNullVars(Class, QuadJoiner). For performance reasons, indexing joiners must be placed before filtering joiners.
        Type Parameters:
        D - the type of the fourth matched fact
        Parameters:
        otherClass - never null
        joiner1 - never null
        joiner2 - never null
        Returns:
        never null, a stream that matches every tuple of A, B and C where D exists for which the QuadJoiners are true
      • ifExistsIncludingNullVars

        default <D> TriConstraintStream<A,​B,​C> ifExistsIncludingNullVars​(Class<D> otherClass,
                                                                                     QuadJoiner<A,​B,​C,​D> joiner1,
                                                                                     QuadJoiner<A,​B,​C,​D> joiner2,
                                                                                     QuadJoiner<A,​B,​C,​D> joiner3)
        As defined by ifExistsIncludingNullVars(Class, QuadJoiner). For performance reasons, indexing joiners must be placed before filtering joiners.
        Type Parameters:
        D - the type of the fourth matched fact
        Parameters:
        otherClass - never null
        joiner1 - never null
        joiner2 - never null
        joiner3 - never null
        Returns:
        never null, a stream that matches every tuple of A, B and C where D exists for which the QuadJoiners are true
      • ifExistsIncludingNullVars

        default <D> TriConstraintStream<A,​B,​C> ifExistsIncludingNullVars​(Class<D> otherClass,
                                                                                     QuadJoiner<A,​B,​C,​D> joiner1,
                                                                                     QuadJoiner<A,​B,​C,​D> joiner2,
                                                                                     QuadJoiner<A,​B,​C,​D> joiner3,
                                                                                     QuadJoiner<A,​B,​C,​D> joiner4)
        As defined by ifExistsIncludingNullVars(Class, QuadJoiner). For performance reasons, indexing joiners must be placed before filtering joiners.
        Type Parameters:
        D - the type of the fourth 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 tuple of A, B and C where D exists for which the QuadJoiners are true
      • ifExistsIncludingNullVars

        <D> TriConstraintStream<A,​B,​C> ifExistsIncludingNullVars​(Class<D> otherClass,
                                                                             QuadJoiner<A,​B,​C,​D>... joiners)
        As defined by ifExistsIncludingNullVars(Class, QuadJoiner). 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 QuadJoiner parameters.

        Type Parameters:
        D - the type of the fourth matched fact
        Parameters:
        otherClass - never null
        joiners - never null
        Returns:
        never null, a stream that matches every tuple of A, B and C where D exists for which the QuadJoiners are true
      • ifNotExists

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

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

        default <D> TriConstraintStream<A,​B,​C> ifNotExists​(Class<D> otherClass,
                                                                       QuadJoiner<A,​B,​C,​D> joiner1,
                                                                       QuadJoiner<A,​B,​C,​D> joiner2,
                                                                       QuadJoiner<A,​B,​C,​D> joiner3,
                                                                       QuadJoiner<A,​B,​C,​D> joiner4)
        As defined by ifNotExists(Class, QuadJoiner). For performance reasons, indexing joiners must be placed before filtering joiners.
        Type Parameters:
        D - the type of the fourth 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 tuple of A, B and C where D does not exist for which the QuadJoiners are true
      • ifNotExists

        <D> TriConstraintStream<A,​B,​C> ifNotExists​(Class<D> otherClass,
                                                               QuadJoiner<A,​B,​C,​D>... joiners)
        As defined by ifNotExists(Class, QuadJoiner). 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 QuadJoiner parameters.

        Type Parameters:
        D - the type of the fourth matched fact
        Parameters:
        otherClass - never null
        joiners - never null
        Returns:
        never null, a stream that matches every tuple of A, B and C where D does not exist for which the QuadJoiners are true
      • ifNotExistsIncludingNullVars

        default <D> TriConstraintStream<A,​B,​C> ifNotExistsIncludingNullVars​(Class<D> otherClass,
                                                                                        QuadJoiner<A,​B,​C,​D> joiner)
        Create a new BiConstraintStream for every tuple of A, B and C where D does not exist for which the QuadJoiner is true (for the properties it extracts from the facts). For classes annotated with PlanningEntity, this method also includes instances with null variables.

        This method has overloaded methods with multiple QuadJoiner parameters.

        Type Parameters:
        D - the type of the fourth matched fact
        Parameters:
        otherClass - never null
        joiner - never null
        Returns:
        never null, a stream that matches every tuple of A, B and C where D does not exist for which the QuadJoiner is true
      • ifNotExistsIncludingNullVars

        default <D> TriConstraintStream<A,​B,​C> ifNotExistsIncludingNullVars​(Class<D> otherClass,
                                                                                        QuadJoiner<A,​B,​C,​D> joiner1,
                                                                                        QuadJoiner<A,​B,​C,​D> joiner2)
        As defined by ifNotExistsIncludingNullVars(Class, QuadJoiner). For performance reasons, indexing joiners must be placed before filtering joiners.
        Type Parameters:
        D - the type of the fourth matched fact
        Parameters:
        otherClass - never null
        joiner1 - never null
        joiner2 - never null
        Returns:
        never null, a stream that matches every tuple of A, B and C where D does not exist for which the QuadJoiners are true
      • ifNotExistsIncludingNullVars

        default <D> TriConstraintStream<A,​B,​C> ifNotExistsIncludingNullVars​(Class<D> otherClass,
                                                                                        QuadJoiner<A,​B,​C,​D> joiner1,
                                                                                        QuadJoiner<A,​B,​C,​D> joiner2,
                                                                                        QuadJoiner<A,​B,​C,​D> joiner3)
        As defined by ifNotExistsIncludingNullVars(Class, QuadJoiner). For performance reasons, indexing joiners must be placed before filtering joiners.
        Type Parameters:
        D - the type of the fourth matched fact
        Parameters:
        otherClass - never null
        joiner1 - never null
        joiner2 - never null
        joiner3 - never null
        Returns:
        never null, a stream that matches every tuple of A, B and C where D does not exist for which the QuadJoiners are true
      • ifNotExistsIncludingNullVars

        default <D> TriConstraintStream<A,​B,​C> ifNotExistsIncludingNullVars​(Class<D> otherClass,
                                                                                        QuadJoiner<A,​B,​C,​D> joiner1,
                                                                                        QuadJoiner<A,​B,​C,​D> joiner2,
                                                                                        QuadJoiner<A,​B,​C,​D> joiner3,
                                                                                        QuadJoiner<A,​B,​C,​D> joiner4)
        As defined by ifNotExistsIncludingNullVars(Class, QuadJoiner). For performance reasons, indexing joiners must be placed before filtering joiners.
        Type Parameters:
        D - the type of the fourth 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 tuple of A, B and C where D does not exist for which the QuadJoiners are true
      • ifNotExistsIncludingNullVars

        <D> TriConstraintStream<A,​B,​C> ifNotExistsIncludingNullVars​(Class<D> otherClass,
                                                                                QuadJoiner<A,​B,​C,​D>... joiners)
        As defined by ifNotExistsIncludingNullVars(Class, QuadJoiner). 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 QuadJoiner parameters.

        Type Parameters:
        D - the type of the fourth matched fact
        Parameters:
        otherClass - never null
        joiners - never null
        Returns:
        never null, a stream that matches every tuple of A, B and C where D does not exist for which the QuadJoiners are true
      • groupBy

        <ResultContainerA_,​ResultA_,​ResultContainerB_,​ResultB_> BiConstraintStream<ResultA_,​ResultB_> groupBy​(TriConstraintCollector<A,​B,​C,​ResultContainerA_,​ResultA_> collectorA,
                                                                                                                                      TriConstraintCollector<A,​B,​C,​ResultContainerB_,​ResultB_> collectorB)
        Convert the TriConstraintStream to a BiConstraintStream, containing only a single tuple, the result of applying two TriConstraintCollectors.
        Type Parameters:
        ResultContainerA_ - the mutable accumulation type (often hidden as an implementation detail)
        ResultA_ - the type of the first fact in the destination BiConstraintStream's tuple
        ResultContainerB_ - the mutable accumulation type (often hidden as an implementation detail)
        ResultB_ - the type of the second fact in the destination BiConstraintStream's tuple
        Parameters:
        collectorA - never null, the collector to perform the first grouping operation with See ConstraintCollectors for common operations, such as count(), sum() and others.
        collectorB - 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
      • groupBy

        <ResultContainerA_,​ResultA_,​ResultContainerB_,​ResultB_,​ResultContainerC_,​ResultC_> TriConstraintStream<ResultA_,​ResultB_,​ResultC_> groupBy​(TriConstraintCollector<A,​B,​C,​ResultContainerA_,​ResultA_> collectorA,
                                                                                                                                                                                             TriConstraintCollector<A,​B,​C,​ResultContainerB_,​ResultB_> collectorB,
                                                                                                                                                                                             TriConstraintCollector<A,​B,​C,​ResultContainerC_,​ResultC_> collectorC)
        Convert the TriConstraintStream to a TriConstraintStream, containing only a single tuple, the result of applying three TriConstraintCollectors.
        Type Parameters:
        ResultContainerA_ - the mutable accumulation type (often hidden as an implementation detail)
        ResultA_ - the type of the first fact in the destination TriConstraintStream's tuple
        ResultContainerB_ - the mutable accumulation type (often hidden as an implementation detail)
        ResultB_ - the type of the second fact in the destination TriConstraintStream's tuple
        ResultContainerC_ - the mutable accumulation type (often hidden as an implementation detail)
        ResultC_ - the type of the third fact in the destination TriConstraintStream's tuple
        Parameters:
        collectorA - never null, the collector to perform the first grouping operation with See ConstraintCollectors for common operations, such as count(), sum() and others.
        collectorB - never null, the collector to perform the second grouping operation with See ConstraintCollectors for common operations, such as count(), sum() and others.
        collectorC - never null, the collector to perform the third grouping operation with See ConstraintCollectors for common operations, such as count(), sum() and others.
        Returns:
        never null
      • groupBy

        <ResultContainerA_,​ResultA_,​ResultContainerB_,​ResultB_,​ResultContainerC_,​ResultC_,​ResultContainerD_,​ResultD_> QuadConstraintStream<ResultA_,​ResultB_,​ResultC_,​ResultD_> groupBy​(TriConstraintCollector<A,​B,​C,​ResultContainerA_,​ResultA_> collectorA,
                                                                                                                                                                                                                                                    TriConstraintCollector<A,​B,​C,​ResultContainerB_,​ResultB_> collectorB,
                                                                                                                                                                                                                                                    TriConstraintCollector<A,​B,​C,​ResultContainerC_,​ResultC_> collectorC,
                                                                                                                                                                                                                                                    TriConstraintCollector<A,​B,​C,​ResultContainerD_,​ResultD_> collectorD)
        Convert the TriConstraintStream to a QuadConstraintStream, containing only a single tuple, the result of applying four TriConstraintCollectors.
        Type Parameters:
        ResultContainerA_ - the mutable accumulation type (often hidden as an implementation detail)
        ResultA_ - the type of the first fact in the destination QuadConstraintStream's tuple
        ResultContainerB_ - the mutable accumulation type (often hidden as an implementation detail)
        ResultB_ - 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:
        collectorA - never null, the collector to perform the first grouping operation with See ConstraintCollectors for common operations, such as count(), sum() and others.
        collectorB - never null, the collector to perform the second grouping operation with See ConstraintCollectors for common operations, such as count(), sum() and others.
        collectorC - never null, the collector to perform the third grouping operation with See ConstraintCollectors for common operations, such as count(), sum() and others.
        collectorD - never null, the collector to perform the fourth grouping operation with See ConstraintCollectors for common operations, such as count(), sum() and others.
        Returns:
        never null
      • groupBy

        <GroupKey_> UniConstraintStream<GroupKey_> groupBy​(TriFunction<A,​B,​C,​GroupKey_> groupKeyMapping)
        Convert the TriConstraintStream to a 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​(TriFunction<A,​B,​C,​GroupKey_> groupKeyMapping,
                                                                                                             TriConstraintCollector<A,​B,​C,​ResultContainer_,​Result_> collector)
        Convert the TriConstraintStream to a BiConstraintStream, 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 TriConstraintCollector 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

        <GroupKey_,​ResultContainerB_,​ResultB_,​ResultContainerC_,​ResultC_> TriConstraintStream<GroupKey_,​ResultB_,​ResultC_> groupBy​(TriFunction<A,​B,​C,​GroupKey_> groupKeyMapping,
                                                                                                                                                                       TriConstraintCollector<A,​B,​C,​ResultContainerB_,​ResultB_> collectorB,
                                                                                                                                                                       TriConstraintCollector<A,​B,​C,​ResultContainerC_,​ResultC_> collectorC)
        Convert the TriConstraintStream to a TriConstraintStream, 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 TriConstraintCollector applied on all incoming tuples with the same first fact.

        Type Parameters:
        GroupKey_ - the type of the first fact in the destination TriConstraintStream's tuple
        ResultContainerB_ - the mutable accumulation type (often hidden as an implementation detail)
        ResultB_ - the type of the second fact in the destination TriConstraintStream's tuple
        ResultContainerC_ - the mutable accumulation type (often hidden as an implementation detail)
        ResultC_ - the type of the third fact in the destination TriConstraintStream's tuple
        Parameters:
        groupKeyMapping - never null, function to convert the fact in the original tuple to a different fact
        collectorB - never null, the collector to perform the first grouping operation with See ConstraintCollectors for common operations, such as count(), sum() and others.
        collectorC - 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
      • groupBy

        <GroupKey_,​ResultContainerB_,​ResultB_,​ResultContainerC_,​ResultC_,​ResultContainerD_,​ResultD_> QuadConstraintStream<GroupKey_,​ResultB_,​ResultC_,​ResultD_> groupBy​(TriFunction<A,​B,​C,​GroupKey_> groupKeyMapping,
                                                                                                                                                                                                                              TriConstraintCollector<A,​B,​C,​ResultContainerB_,​ResultB_> collectorB,
                                                                                                                                                                                                                              TriConstraintCollector<A,​B,​C,​ResultContainerC_,​ResultC_> collectorC,
                                                                                                                                                                                                                              TriConstraintCollector<A,​B,​C,​ResultContainerD_,​ResultD_> collectorD)
        Convert the TriConstraintStream to a QuadConstraintStream, 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 TriConstraintCollector applied on all incoming tuples with the same first fact.

        Type Parameters:
        GroupKey_ - the type of the first fact in the destination QuadConstraintStream's tuple
        ResultContainerB_ - the mutable accumulation type (often hidden as an implementation detail)
        ResultB_ - 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:
        groupKeyMapping - never null, function to convert the fact in the original tuple to a different fact
        collectorB - never null, the collector to perform the first grouping operation with See ConstraintCollectors for common operations, such as count(), sum() and others.
        collectorC - never null, the collector to perform the second grouping operation with See ConstraintCollectors for common operations, such as count(), sum() and others.
        collectorD - never null, the collector to perform the third grouping operation with See ConstraintCollectors for common operations, such as count(), sum() and others.
        Returns:
        never null
      • groupBy

        <GroupKeyA_,​GroupKeyB_> BiConstraintStream<GroupKeyA_,​GroupKeyB_> groupBy​(TriFunction<A,​B,​C,​GroupKeyA_> groupKeyAMapping,
                                                                                              TriFunction<A,​B,​C,​GroupKeyB_> groupKeyBMapping)
        Convert the TriConstraintStream to a BiConstraintStream, 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 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 facts in the original tuple to a new fact
        groupKeyBMapping - never null, function to convert the facts in the original tuple to another new fact
        Returns:
        never null
      • groupBy

        <GroupKeyA_,​GroupKeyB_,​ResultContainerC_,​ResultC_,​ResultContainerD_,​ResultD_> QuadConstraintStream<GroupKeyA_,​GroupKeyB_,​ResultC_,​ResultD_> groupBy​(TriFunction<A,​B,​C,​GroupKeyA_> groupKeyAMapping,
                                                                                                                                                                                                            TriFunction<A,​B,​C,​GroupKeyB_> groupKeyBMapping,
                                                                                                                                                                                                            TriConstraintCollector<A,​B,​C,​ResultContainerC_,​ResultC_> collectorC,
                                                                                                                                                                                                            TriConstraintCollector<A,​B,​C,​ResultContainerD_,​ResultD_> collectorD)
        Combines the semantics of groupBy(TriFunction, TriFunction) and groupBy(TriConstraintCollector). That is, the first and second facts in the tuple follow the groupBy(TriFunction, TriFunction) semantics. The third fact is the result of applying the first TriConstraintCollector.finisher() on all the tuples of the original TriConstraintStream that belong to the group. The fourth fact is the result of applying the second TriConstraintCollector.finisher() on all the tuples of the original TriConstraintStream 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
      • groupBy

        <GroupKeyA_,​GroupKeyB_,​GroupKeyC_> TriConstraintStream<GroupKeyA_,​GroupKeyB_,​GroupKeyC_> groupBy​(TriFunction<A,​B,​C,​GroupKeyA_> groupKeyAMapping,
                                                                                                                                 TriFunction<A,​B,​C,​GroupKeyB_> groupKeyBMapping,
                                                                                                                                 TriFunction<A,​B,​C,​GroupKeyC_> groupKeyCMapping)
        Convert the TriConstraintStream to a TriConstraintStream, 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 destination TriConstraintStream's tuple
        GroupKeyB_ - the type of the second fact in the destination TriConstraintStream's tuple
        GroupKeyC_ - 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
        groupKeyCMapping - 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​(TriFunction<A,​B,​C,​GroupKeyA_> groupKeyAMapping,
                                                                                                                                                                                        TriFunction<A,​B,​C,​GroupKeyB_> groupKeyBMapping,
                                                                                                                                                                                        TriFunction<A,​B,​C,​GroupKeyC_> groupKeyCMapping,
                                                                                                                                                                                        TriConstraintCollector<A,​B,​C,​ResultContainerD_,​ResultD_> collectorD)
        Combines the semantics of groupBy(TriFunction, TriFunction) and groupBy(TriConstraintCollector). That is, the first three facts in the tuple follow the groupBy(TriFunction, TriFunction) semantics. The final fact is the result of applying the first TriConstraintCollector.finisher() on all the tuples of the original TriConstraintStream 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
        GroupKeyC_ - 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
        groupKeyCMapping - never null, function to convert the original tuple into a third fact
        collectorD - 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_,​GroupKeyC_,​GroupKeyD_> QuadConstraintStream<GroupKeyA_,​GroupKeyB_,​GroupKeyC_,​GroupKeyD_> groupBy​(TriFunction<A,​B,​C,​GroupKeyA_> groupKeyAMapping,
                                                                                                                                                                    TriFunction<A,​B,​C,​GroupKeyB_> groupKeyBMapping,
                                                                                                                                                                    TriFunction<A,​B,​C,​GroupKeyC_> groupKeyCMapping,
                                                                                                                                                                    TriFunction<A,​B,​C,​GroupKeyD_> groupKeyDMapping)
        Convert the TriConstraintStream to a QuadConstraintStream, 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 destination QuadConstraintStream's tuple
        GroupKeyB_ - the type of the second fact in the destination QuadConstraintStream's tuple
        GroupKeyC_ - the type of the third fact in the destination QuadConstraintStream's tuple
        GroupKeyD_ - 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
        groupKeyCMapping - never null, function to convert the original tuple into a third fact
        groupKeyDMapping - never null, function to convert the original tuple into a fourth fact
        Returns:
        never null
      • distinct

        TriConstraintStream<A,​B,​C> distinct()
        Removes duplicate tuples from the stream, according to the tuple's facts equals/hashCode methods, such that only distinct tuples remain. (No two tuples will equal.)

        By default, tuples going through a constraint stream are distinct. However, operations such as map(TriFunction) 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
      • penalizeLong

        default Constraint penalizeLong​(String constraintName,
                                        Score<?> constraintWeight,
                                        ToLongTriFunction<A,​B,​C> 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,
                                              TriFunction<A,​B,​C,​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,
                                      ToLongTriFunction<A,​B,​C> 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,
                                            TriFunction<A,​B,​C,​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,
                                      ToLongTriFunction<A,​B,​C> 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,
                                            TriFunction<A,​B,​C,​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(...) unless you intend to mix 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