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

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

        default <B> BiConstraintStream<A,​B> join​(UniConstraintStream<B> otherStream,
                                                       BiJoiner<A,​B>... joiners)
        As defined by join(UniConstraintStream, 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:
        otherStream - 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
      • 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.

        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.

        Note that, if a legacy constraint stream uses ConstraintFactory.from(Class) as opposed to ConstraintFactory.forEach(Class), a different range of B may be selected. (See ConstraintFactory.from(Class) Javadoc.)

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

        <B> BiConstraintStream<A,​B> join​(Class<B> otherClass,
                                               BiJoiner<A,​B>... joiners)
        As defined by join(Class, BiJoiner). 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> 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
      • ifExistsIncludingNullVars

        default <B> UniConstraintStream<A> ifExistsIncludingNullVars​(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). For classes annotated with PlanningEntity, this method also includes instances with null variables.

        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
      • ifExistsIncludingNullVars

        default <B> UniConstraintStream<A> ifExistsIncludingNullVars​(Class<B> otherClass,
                                                                     BiJoiner<A,​B> joiner1,
                                                                     BiJoiner<A,​B> joiner2)
        As defined by ifExistsIncludingNullVars(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
      • ifExistsIncludingNullVars

        default <B> UniConstraintStream<A> ifExistsIncludingNullVars​(Class<B> otherClass,
                                                                     BiJoiner<A,​B> joiner1,
                                                                     BiJoiner<A,​B> joiner2,
                                                                     BiJoiner<A,​B> joiner3)
        As defined by ifExistsIncludingNullVars(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
      • ifExistsIncludingNullVars

        default <B> UniConstraintStream<A> ifExistsIncludingNullVars​(Class<B> otherClass,
                                                                     BiJoiner<A,​B> joiner1,
                                                                     BiJoiner<A,​B> joiner2,
                                                                     BiJoiner<A,​B> joiner3,
                                                                     BiJoiner<A,​B> joiner4)
        As defined by ifExistsIncludingNullVars(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
      • ifExistsIncludingNullVars

        <B> UniConstraintStream<A> ifExistsIncludingNullVars​(Class<B> otherClass,
                                                             BiJoiner<A,​B>... joiners)
        As defined by ifExistsIncludingNullVars(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> 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). 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
      • ifExistsOtherIncludingNullVars

        default UniConstraintStream<A> ifExistsOtherIncludingNullVars​(Class<A> otherClass)
        Create a new UniConstraintStream for every A, if another A exists that does not Object.equals(Object) the first. For classes annotated with PlanningEntity, this method also includes instances with null variables.
        Parameters:
        otherClass - never null
        Returns:
        never null, a stream that matches every A where a different A exists
      • ifExistsOtherIncludingNullVars

        default UniConstraintStream<A> ifExistsOtherIncludingNullVars​(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). For classes annotated with PlanningEntity, this method also includes instances with null variables.

        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
      • ifExistsOtherIncludingNullVars

        default UniConstraintStream<A> ifExistsOtherIncludingNullVars​(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
      • ifExistsOtherIncludingNullVars

        default UniConstraintStream<A> ifExistsOtherIncludingNullVars​(Class<A> otherClass,
                                                                      BiJoiner<A,​A> joiner1,
                                                                      BiJoiner<A,​A> joiner2,
                                                                      BiJoiner<A,​A> joiner3)
        As defined by ifExistsOtherIncludingNullVars(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
      • ifExistsOtherIncludingNullVars

        default UniConstraintStream<A> ifExistsOtherIncludingNullVars​(Class<A> otherClass,
                                                                      BiJoiner<A,​A> joiner1,
                                                                      BiJoiner<A,​A> joiner2,
                                                                      BiJoiner<A,​A> joiner3,
                                                                      BiJoiner<A,​A> joiner4)
        As defined by ifExistsOtherIncludingNullVars(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
      • ifExistsOtherIncludingNullVars

        default UniConstraintStream<A> ifExistsOtherIncludingNullVars​(Class<A> otherClass,
                                                                      BiJoiner<A,​A>... joiners)
        As defined by ifExistsOtherIncludingNullVars(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> 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
      • ifNotExistsIncludingNullVars

        default <B> UniConstraintStream<A> ifNotExistsIncludingNullVars​(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). For classes annotated with PlanningEntity, this method also includes instances with null variables.

        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
      • ifNotExistsIncludingNullVars

        default <B> UniConstraintStream<A> ifNotExistsIncludingNullVars​(Class<B> otherClass,
                                                                        BiJoiner<A,​B> joiner1,
                                                                        BiJoiner<A,​B> joiner2)
        As defined by ifNotExistsIncludingNullVars(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
      • ifNotExistsIncludingNullVars

        default <B> UniConstraintStream<A> ifNotExistsIncludingNullVars​(Class<B> otherClass,
                                                                        BiJoiner<A,​B> joiner1,
                                                                        BiJoiner<A,​B> joiner2,
                                                                        BiJoiner<A,​B> joiner3)
        As defined by ifNotExistsIncludingNullVars(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
      • ifNotExistsIncludingNullVars

        default <B> UniConstraintStream<A> ifNotExistsIncludingNullVars​(Class<B> otherClass,
                                                                        BiJoiner<A,​B> joiner1,
                                                                        BiJoiner<A,​B> joiner2,
                                                                        BiJoiner<A,​B> joiner3,
                                                                        BiJoiner<A,​B> joiner4)
        As defined by ifNotExistsIncludingNullVars(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
      • ifNotExistsIncludingNullVars

        <B> UniConstraintStream<A> ifNotExistsIncludingNullVars​(Class<B> otherClass,
                                                                BiJoiner<A,​B>... joiners)
        As defined by ifNotExistsIncludingNullVars(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> 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). 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
      • ifNotExistsOtherIncludingNullVars

        default UniConstraintStream<A> ifNotExistsOtherIncludingNullVars​(Class<A> otherClass)
        Create a new UniConstraintStream for every A, if no other A exists that does not Object.equals(Object) the first. For classes annotated with PlanningEntity, this method also includes instances with null variables.
        Parameters:
        otherClass - never null
        Returns:
        never null, a stream that matches every A where a different A does not exist
      • ifNotExistsOtherIncludingNullVars

        default UniConstraintStream<A> ifNotExistsOtherIncludingNullVars​(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). For classes annotated with PlanningEntity, this method also includes instances with null variables.

        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
      • ifNotExistsOtherIncludingNullVars

        default UniConstraintStream<A> ifNotExistsOtherIncludingNullVars​(Class<A> otherClass,
                                                                         BiJoiner<A,​A> joiner1,
                                                                         BiJoiner<A,​A> joiner2)
        As defined by ifNotExistsOtherIncludingNullVars(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
      • ifNotExistsOtherIncludingNullVars

        default UniConstraintStream<A> ifNotExistsOtherIncludingNullVars​(Class<A> otherClass,
                                                                         BiJoiner<A,​A> joiner1,
                                                                         BiJoiner<A,​A> joiner2,
                                                                         BiJoiner<A,​A> joiner3)
        As defined by ifNotExistsOtherIncludingNullVars(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
      • ifNotExistsOtherIncludingNullVars

        default UniConstraintStream<A> ifNotExistsOtherIncludingNullVars​(Class<A> otherClass,
                                                                         BiJoiner<A,​A> joiner1,
                                                                         BiJoiner<A,​A> joiner2,
                                                                         BiJoiner<A,​A> joiner3,
                                                                         BiJoiner<A,​A> joiner4)
        As defined by ifNotExistsOtherIncludingNullVars(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
      • ifNotExistsOtherIncludingNullVars

        default UniConstraintStream<A> ifNotExistsOtherIncludingNullVars​(Class<A> otherClass,
                                                                         BiJoiner<A,​A>... joiners)
        As defined by ifNotExistsOtherIncludingNullVars(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

        <ResultContainerA_,​ResultA_,​ResultContainerB_,​ResultB_> BiConstraintStream<ResultA_,​ResultB_> groupBy​(UniConstraintCollector<A,​ResultContainerA_,​ResultA_> collectorA,
                                                                                                                                      UniConstraintCollector<A,​ResultContainerB_,​ResultB_> collectorB)
        Convert the UniConstraintStream to a BiConstraintStream, containing only a single tuple, the result of applying two UniConstraintCollectors.
        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​(UniConstraintCollector<A,​ResultContainerA_,​ResultA_> collectorA,
                                                                                                                                                                                             UniConstraintCollector<A,​ResultContainerB_,​ResultB_> collectorB,
                                                                                                                                                                                             UniConstraintCollector<A,​ResultContainerC_,​ResultC_> collectorC)
        Convert the UniConstraintStream to a TriConstraintStream, containing only a single tuple, the result of applying three UniConstraintCollectors.
        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​(UniConstraintCollector<A,​ResultContainerA_,​ResultA_> collectorA,
                                                                                                                                                                                                                                                    UniConstraintCollector<A,​ResultContainerB_,​ResultB_> collectorB,
                                                                                                                                                                                                                                                    UniConstraintCollector<A,​ResultContainerC_,​ResultC_> collectorC,
                                                                                                                                                                                                                                                    UniConstraintCollector<A,​ResultContainerD_,​ResultD_> collectorD)
        Convert the UniConstraintStream to a QuadConstraintStream, containing only a single tuple, the result of applying four UniConstraintCollectors.
        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​(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 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

        <GroupKey_,​ResultContainerB_,​ResultB_,​ResultContainerC_,​ResultC_> TriConstraintStream<GroupKey_,​ResultB_,​ResultC_> groupBy​(Function<A,​GroupKey_> groupKeyMapping,
                                                                                                                                                                       UniConstraintCollector<A,​ResultContainerB_,​ResultB_> collectorB,
                                                                                                                                                                       UniConstraintCollector<A,​ResultContainerC_,​ResultC_> collectorC)
        Convert the UniConstraintStream 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 UniConstraintCollector 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​(Function<A,​GroupKey_> groupKeyMapping,
                                                                                                                                                                                                                              UniConstraintCollector<A,​ResultContainerB_,​ResultB_> collectorB,
                                                                                                                                                                                                                              UniConstraintCollector<A,​ResultContainerC_,​ResultC_> collectorC,
                                                                                                                                                                                                                              UniConstraintCollector<A,​ResultContainerD_,​ResultD_> collectorD)
        Convert the UniConstraintStream 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 UniConstraintCollector 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​(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
      • groupBy

        <GroupKeyA_,​GroupKeyB_,​GroupKeyC_> TriConstraintStream<GroupKeyA_,​GroupKeyB_,​GroupKeyC_> groupBy​(Function<A,​GroupKeyA_> groupKeyAMapping,
                                                                                                                                 Function<A,​GroupKeyB_> groupKeyBMapping,
                                                                                                                                 Function<A,​GroupKeyC_> groupKeyCMapping)
        Convert the UniConstraintStream 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​(Function<A,​GroupKeyA_> groupKeyAMapping,
                                                                                                                                                                                        Function<A,​GroupKeyB_> groupKeyBMapping,
                                                                                                                                                                                        Function<A,​GroupKeyC_> groupKeyCMapping,
                                                                                                                                                                                        UniConstraintCollector<A,​ResultContainerD_,​ResultD_> collectorD)
        Combines the semantics of groupBy(Function, Function) and groupBy(UniConstraintCollector). That is, the first three facts in the tuple follow the groupBy(Function, Function) semantics. The final fact is the result of applying the first 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
        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​(Function<A,​GroupKeyA_> groupKeyAMapping,
                                                                                                                                                                    Function<A,​GroupKeyB_> groupKeyBMapping,
                                                                                                                                                                    Function<A,​GroupKeyC_> groupKeyCMapping,
                                                                                                                                                                    Function<A,​GroupKeyD_> groupKeyDMapping)
        Convert the UniConstraintStream 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 - * calling map(Person::getAge) on such stream will produce a stream of Integers * [20, 25, 30],
        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
      • map

        <ResultA_> UniConstraintStream<ResultA_> map​(Function<A,​ResultA_> mapping)
        Transforms the stream in such a way that tuples are remapped using the given function. This may produce a stream with duplicate tuples. See distinct() for details. There are several recommendations for implementing the mapping function:
        • Purity. The mapping function should only depend on its input. That is, given the same input, it always returns the same output.
        • Bijectivity. No two input tuples should map to the same output tuple, or to tuples that are equal. Not following this recommendation creates a constraint stream with duplicate tuples, and may force you to use distinct() later, which comes with a performance cost.
        • Immutable data carriers. The objects returned by the mapping function should be identified by their contents and nothing else. If two of them have contents which equal, then they should likewise equal and preferably be the same instance. The objects returned by the mapping function should also be immutable, meaning their contents should not be allowed to change.

        Simple example: assuming a constraint stream of tuples of Persons [Ann(age = 20), Beth(age = 25), Cathy(age = 30)], calling map(Person::getAge) on such stream will produce a stream of Integers [20, 25, 30],

        Example with a non-bijective mapping function: assuming a constraint stream of tuples of Persons [Ann(age = 20), Beth(age = 25), Cathy(age = 30), David(age = 30), Eric(age = 20)], calling map(Person::getAge) on such stream will produce a stream of Integers [20, 25, 30, 30, 20].

        Type Parameters:
        ResultA_ - the type of the only fact in the resulting UniConstraintStream's tuple
        Parameters:
        mapping - never null, function to convert the original tuple into the new tuple
        Returns:
        never null
      • flattenLast

        <ResultA_> UniConstraintStream<ResultA_> flattenLast​(Function<A,​Iterable<ResultA_>> mapping)
        Takes each tuple and applies a mapping on it, which turns the tuple into a Iterable. Returns a constraint stream consisting of contents of those iterables. This may produce a stream with duplicate tuples. See distinct() for details.

        In cases where the original tuple is already an Iterable, use Function.identity() as the argument.

        Simple example: assuming a constraint stream of tuples of Persons [Ann(roles = [USER, ADMIN]]), Beth(roles = [USER]), Cathy(roles = [ADMIN, AUDITOR])], calling flattenLast(Person::getRoles) on such stream will produce a stream of [USER, ADMIN, USER, ADMIN, AUDITOR].

        Type Parameters:
        ResultA_ - the type of facts in the resulting tuples
        Parameters:
        mapping - never null, function to convert the original tuple into Iterable
        Returns:
        never null
      • distinct

        UniConstraintStream<A> distinct()
        Transforms the stream in such a way that all the tuples going through it are distinct. (No two tuples will equal.)

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