P1
- parameter type 1P2
- parameter type 2P3
- parameter type 3P4
- parameter type 4P5
- parameter type 5P6
- parameter type 6P7
- parameter type 7P8
- parameter type 8@FunctionalInterface public interface Predicate8<P1,P2,P3,P4,P5,P6,P7,P8> extends Predicate1<ITuple8<? extends P1,? extends P2,? extends P3,? extends P4,? extends P5,? extends P6,? extends P7,? extends P8>>
Predicates can be chained to simulate boolean logic by
and(Predicate8)
, or(Predicate8)
,
xor(Predicate8)
, and negate()
.
There is a general problem with combining types which don't
allow to use the above combination methods in all cases
similar to standard Java's logical expressions. The following
static methods of this interface may be used in all cases:
and(Predicate8, Predicate8)
,
or(Predicate8, Predicate8)
,
and xor(Predicate8, Predicate8)
.
Useful for start values in algorithms or as default values
are the two values returned by alwaysTrue()
(a predicate which always returns true
regardless
the argument applied to the test(Object, Object, Object, Object, Object, Object, Object, Object)
method)
and alwaysFalse()
(same for false
).
Partial evaluation is also possible.
Predicate1
,
Predicate2
,
Predicate3
,
Predicate4
,
Predicate5
,
Predicate6
,
Predicate7
,
Predicate9
ALWAYS_FALSE, ALWAYS_TRUE
Modifier and Type | Method and Description |
---|---|
default <FR extends ITuple8<? extends P1,? extends P2,? extends P3,? extends P4,? extends P5,? extends P6,? extends P7,? extends P8>,FP> |
after1(java.util.function.Function<FP,FR> before)
Get a chained predicate which first applies the given function, then this predicate.
|
default <FR extends ITuple8<? extends P1,? extends P2,? extends P3,? extends P4,? extends P5,? extends P6,? extends P7,? extends P8>,FP1,FP2> |
after2(java.util.function.BiFunction<FP1,FP2,FR> before)
Get a chained predicate which first applies the given 2-parameter function, then this predicate.
|
default <FR extends ITuple8<? extends P1,? extends P2,? extends P3,? extends P4,? extends P5,? extends P6,? extends P7,? extends P8>,FP1,FP2,FP3> |
after3(Function3<FR,FP1,FP2,FP3> before)
Get a chained predicate which first applies the given 3-parameter function, then this predicate.
|
default <FR extends ITuple8<? extends P1,? extends P2,? extends P3,? extends P4,? extends P5,? extends P6,? extends P7,? extends P8>,FP1,FP2,FP3,FP4,FP5> |
after5(Function5<FR,FP1,FP2,FP3,FP4,FP5> before)
Get a chained predicate which first applies the given 5-parameter function, then this predicate.
|
default <FR extends ITuple8<? extends P1,? extends P2,? extends P3,? extends P4,? extends P5,? extends P6,? extends P7,? extends P8>,FP1,FP2,FP3,FP4,FP5,FP6> |
after6(Function6<FR,FP1,FP2,FP3,FP4,FP5,FP6> before)
Get a chained predicate which first applies the given 6-parameter function, then this predicate.
|
default <FR extends ITuple8<? extends P1,? extends P2,? extends P3,? extends P4,? extends P5,? extends P6,? extends P7,? extends P8>,FP1,FP2,FP3,FP4,FP5,FP6,FP7> |
after7(Function7<FR,FP1,FP2,FP3,FP4,FP5,FP6,FP7> before)
Get a chained predicate which first applies the given 7-parameter function, then this one.
|
default <FR extends ITuple8<? extends P1,? extends P2,? extends P3,? extends P4,? extends P5,? extends P6,? extends P7,? extends P8>,FP1,FP2,FP3,FP4,FP5,FP6,FP7,FP8> |
after8(Function8<FR,FP1,FP2,FP3,FP4,FP5,FP6,FP7,FP8> before)
Get a chained predicate which first applies the given 8-parameter function, then this one.
|
default <FR extends ITuple8<? extends P1,? extends P2,? extends P3,? extends P4,? extends P5,? extends P6,? extends P7,? extends P8>,FP1,FP2,FP3,FP4,FP5,FP6,FP7,FP8,FP9> |
after9(Function9<FR,FP1,FP2,FP3,FP4,FP5,FP6,FP7,FP8,FP9> before)
Get a chained predicate which first applies the given 9-parameter function, then this one.
|
static <T1,T2,T3,T4,T5,T6,T7,T8> |
alwaysFalse()
Get a predicate which always evaluates to
false . |
static <T1,T2,T3,T4,T5,T6,T7,T8> |
alwaysTrue()
Get a predicate which always evaluates to
true . |
default Predicate8<P1,P2,P3,P4,P5,P6,P7,P8> |
and(Predicate8<? super P1,? super P2,? super P3,? super P4,? super P5,? super P6,? super P7,? super P8> other)
Combine this and another predicate with logical and.
|
static <T1,T2,T3,T4,T5,T6,T7,T8> |
and(Predicate8<? super T1,? super T2,? super T3,? super T4,? super T5,? super T6,? super T7,? super T8> pred1,
Predicate8<? super T1,? super T2,? super T3,? super T4,? super T5,? super T6,? super T7,? super T8> pred2)
Get a predicate which is the combination of two predicates
with a logical and.
|
default Predicate8<P1,P2,P3,P4,P5,P6,P7,P8> |
negate()
Get the negation of this predicate.
|
default Predicate8<P1,P2,P3,P4,P5,P6,P7,P8> |
or(Predicate8<? super P1,? super P2,? super P3,? super P4,? super P5,? super P6,? super P7,? super P8> other)
Combine this and another predicate with logical or.
|
static <T1,T2,T3,T4,T5,T6,T7,T8> |
or(Predicate8<? super T1,? super T2,? super T3,? super T4,? super T5,? super T6,? super T7,? super T8> pred1,
Predicate8<? super T1,? super T2,? super T3,? super T4,? super T5,? super T6,? super T7,? super T8> pred2)
Get a predicate which is the combination of two predicates
with a logical or.
|
default Predicate7<P2,P3,P4,P5,P6,P7,P8> |
partial1(P1 argument)
Get a partially applied predicate with a fix first argument.
|
default Predicate7<P1,P3,P4,P5,P6,P7,P8> |
partial2(P2 argument)
Get a partially applied predicate with a fix second argument.
|
default Predicate7<P1,P2,P4,P5,P6,P7,P8> |
partial3(P3 argument)
Get a partially applied predicate with a fix third argument.
|
default Predicate7<P1,P2,P3,P5,P6,P7,P8> |
partial4(P4 argument)
Get a partially applied predicate with a fix fourth argument.
|
default Predicate7<P1,P2,P3,P4,P6,P7,P8> |
partial5(P5 argument)
Get a partially applied predicate with a fix fifth argument.
|
default Predicate7<P1,P2,P3,P4,P5,P7,P8> |
partial6(P6 argument)
Get a partially applied predicate with a fix sixth argument.
|
default Predicate7<P1,P2,P3,P4,P5,P6,P8> |
partial7(P7 argument)
Get a partially applied predicate with a fix seventh argument.
|
default Predicate7<P1,P2,P3,P4,P5,P6,P7> |
partial8(P8 argument)
Get a partially applied predicate with a fix eighth argument.
|
default boolean |
test(ITuple8<? extends P1,? extends P2,? extends P3,? extends P4,? extends P5,? extends P6,? extends P7,? extends P8> tuple8)
Expand a tuple into the arguments of this predicate.
|
boolean |
test(P1 arg1,
P2 arg2,
P3 arg3,
P4 arg4,
P5 arg5,
P6 arg6,
P7 arg7,
P8 arg8)
Test the given values.
|
default Predicate8<P1,P2,P3,P4,P5,P6,P7,P8> |
xor(Predicate8<? super P1,? super P2,? super P3,? super P4,? super P5,? super P6,? super P7,? super P8> other)
Combine this and another predicate with logical exclusive or.
|
static <T1,T2,T3,T4,T5,T6,T7,T8> |
xor(Predicate8<? super T1,? super T2,? super T3,? super T4,? super T5,? super T6,? super T7,? super T8> pred1,
Predicate8<? super T1,? super T2,? super T3,? super T4,? super T5,? super T6,? super T7,? super T8> pred2)
Get a predicate which is the combination of two predicates
with a logical exclusive or.
|
boolean test(P1 arg1, P2 arg2, P3 arg3, P4 arg4, P5 arg5, P6 arg6, P7 arg7, P8 arg8)
arg1
- function argument 1arg2
- function argument 2arg3
- function argument 3arg4
- function argument 4arg5
- function argument 5arg6
- function argument 6arg7
- function argument 7arg8
- function argument 8true
or false
default boolean test(@NotNull ITuple8<? extends P1,? extends P2,? extends P3,? extends P4,? extends P5,? extends P6,? extends P7,? extends P8> tuple8)
@NotNull default Predicate8<P1,P2,P3,P4,P5,P6,P7,P8> and(@NotNull Predicate8<? super P1,? super P2,? super P3,? super P4,? super P5,? super P6,? super P7,? super P8> other)
false
the other one is
not evaluated.
This method has a problem if either one of the argument types
pf the parameter is not a super class of this predicate's
parameter types. See and(Predicate8, Predicate8)
for such cases.
other
- other predicate to be chained with logical and@NotNull default Predicate8<P1,P2,P3,P4,P5,P6,P7,P8> or(@NotNull Predicate8<? super P1,? super P2,? super P3,? super P4,? super P5,? super P6,? super P7,? super P8> other)
true
the other one is
not evaluated.
This method has a problem if either one of the argument types
pf the parameter is not a super class of this predicate's
parameter types. See or(Predicate8, Predicate8)
for such cases.
other
- other predicate to be chained with logical or@NotNull default Predicate8<P1,P2,P3,P4,P5,P6,P7,P8> xor(@NotNull Predicate8<? super P1,? super P2,? super P3,? super P4,? super P5,? super P6,? super P7,? super P8> other)
This method has a problem if either one of the argument types
pf the parameter is not a super class of this predicate's
parameter types. See xor(Predicate8, Predicate8)
for such cases.
other
- other predicate to be chained with logical exclusive or@NotNull default Predicate8<P1,P2,P3,P4,P5,P6,P7,P8> negate()
negate
in interface java.util.function.Predicate<ITuple8<? extends P1,? extends P2,? extends P3,? extends P4,? extends P5,? extends P6,? extends P7,? extends P8>>
negate
in interface Predicate1<ITuple8<? extends P1,? extends P2,? extends P3,? extends P4,? extends P5,? extends P6,? extends P7,? extends P8>>
@NotNull default Predicate7<P2,P3,P4,P5,P6,P7,P8> partial1(P1 argument)
argument
- value applied for first argument@NotNull default Predicate7<P1,P3,P4,P5,P6,P7,P8> partial2(P2 argument)
argument
- value applied for second argument@NotNull default Predicate7<P1,P2,P4,P5,P6,P7,P8> partial3(P3 argument)
argument
- value applied for third argument@NotNull default Predicate7<P1,P2,P3,P5,P6,P7,P8> partial4(P4 argument)
argument
- value applied for fourth argument@NotNull default Predicate7<P1,P2,P3,P4,P6,P7,P8> partial5(P5 argument)
argument
- value applied for fifth argument@NotNull default Predicate7<P1,P2,P3,P4,P5,P7,P8> partial6(P6 argument)
argument
- value applied for sixth argument@NotNull default Predicate7<P1,P2,P3,P4,P5,P6,P8> partial7(P7 argument)
argument
- value applied for seventh argument@NotNull default Predicate7<P1,P2,P3,P4,P5,P6,P7> partial8(P8 argument)
argument
- value applied for eighth argument@NotNull static <T1,T2,T3,T4,T5,T6,T7,T8> Predicate8<T1,T2,T3,T4,T5,T6,T7,T8> alwaysTrue()
true
.alwaysTrue
in interface Predicate1<ITuple8<? extends P1,? extends P2,? extends P3,? extends P4,? extends P5,? extends P6,? extends P7,? extends P8>>
T1
- type of first predicate parameterT2
- type of second predicate parameterT3
- type of third predicate parameterT4
- type of fourth predicate parameterT5
- type of fifth predicate parameterT6
- type of sixth predicate parameterT7
- type of seventh predicate parameterT8
- type of eighth predicate parametertrue
@NotNull static <T1,T2,T3,T4,T5,T6,T7,T8> Predicate8<T1,T2,T3,T4,T5,T6,T7,T8> alwaysFalse()
false
.alwaysFalse
in interface Predicate1<ITuple8<? extends P1,? extends P2,? extends P3,? extends P4,? extends P5,? extends P6,? extends P7,? extends P8>>
T1
- type of first predicate parameterT2
- type of second predicate parameterT3
- type of third predicate parameterT4
- type of fourth predicate parameterT5
- type of fifth predicate parameterT6
- type of sixth predicate parameterT7
- type of seventh predicate parameterT8
- type of eighth predicate parameterfalse
@NotNull static <T1,T2,T3,T4,T5,T6,T7,T8> Predicate8<T1,T2,T3,T4,T5,T6,T7,T8> and(@NotNull Predicate8<? super T1,? super T2,? super T3,? super T4,? super T5,? super T6,? super T7,? super T8> pred1, @NotNull Predicate8<? super T1,? super T2,? super T3,? super T4,? super T5,? super T6,? super T7,? super T8> pred2)
The result will use shortcut evaluation, so if this
predicate already returns false
the other one is
not evaluated.
T1
- resulting type of first argument,
which is the most extending type of both pred1
's
first argument type and pred2
's first argument type,
so if neither type is extending the
other this method will not compileT2
- resulting type of second argument, see <T1>
for the fine printT3
- resulting type of third argument, see <T1>
for the fine printT4
- resulting type of fourth argument, see <T1>
for the fine printT5
- resulting type of fifth argument, see <T1>
for the fine printT6
- resulting type of sixth argument, see <T1>
for the fine printT7
- resulting type of seventh argument, see <T1>
for the fine printT8
- resulting type of eighth argument, see <T1>
for the fine printpred1
- first predicatepred2
- second predicateand(Predicate8)
@NotNull static <T1,T2,T3,T4,T5,T6,T7,T8> Predicate8<T1,T2,T3,T4,T5,T6,T7,T8> or(@NotNull Predicate8<? super T1,? super T2,? super T3,? super T4,? super T5,? super T6,? super T7,? super T8> pred1, @NotNull Predicate8<? super T1,? super T2,? super T3,? super T4,? super T5,? super T6,? super T7,? super T8> pred2)
The result will use shortcut evaluation, so if this
predicate already returns true
the other one is
not evaluated.
T1
- resulting type of first argument,
which is the most extending type of both pred1
's
first argument type and pred2
's first argument type,
so if neither type is extending the
other this method will not compileT2
- resulting type of second argument, see <T1>
for the fine printT3
- resulting type of third argument, see <T1>
for the fine printT4
- resulting type of fourth argument, see <T1>
for the fine printT5
- resulting type of fifth argument, see <T1>
for the fine printT6
- resulting type of sixth argument, see <T1>
for the fine printT7
- resulting type of seventh argument, see <T1>
for the fine printT8
- resulting type of eighth argument, see <T1>
for the fine printpred1
- first predicatepred2
- second predicateor(Predicate8)
@NotNull static <T1,T2,T3,T4,T5,T6,T7,T8> Predicate8<T1,T2,T3,T4,T5,T6,T7,T8> xor(@NotNull Predicate8<? super T1,? super T2,? super T3,? super T4,? super T5,? super T6,? super T7,? super T8> pred1, @NotNull Predicate8<? super T1,? super T2,? super T3,? super T4,? super T5,? super T6,? super T7,? super T8> pred2)
The result will use shortcut evaluation, so if this
predicate already returns true
the other one is
not evaluated.
T1
- resulting type of first argument,
which is the most extending type of both pred1
's
first argument type and pred2
's first argument type,
so if neither type is extending the
other this method will not compileT2
- resulting type of second argument, see <T1>
for the fine printT3
- resulting type of third argument, see <T1>
for the fine printT4
- resulting type of fourth argument, see <T1>
for the fine printT5
- resulting type of fifth argument, see <T1>
for the fine printT6
- resulting type of sixth argument, see <T1>
for the fine printT7
- resulting type of seventh argument, see <T1>
for the fine printT8
- resulting type of eighth argument, see <T1>
for the fine printpred1
- first predicatepred2
- second predicatexor(Predicate8)
@NotNull default <FR extends ITuple8<? extends P1,? extends P2,? extends P3,? extends P4,? extends P5,? extends P6,? extends P7,? extends P8>,FP> Predicate1<FP> after1(@NotNull java.util.function.Function<FP,FR> before)
ITuple8
with matching parametric types
which are applied in their order to this predicate.FR
- function before
's return type, has to be a 8-tuple with matching typesFP
- function before
's parameter type, same for returned predicatebefore
- function to apply first, has to return a non-null
result so unpacking the parameters
from the tuple is possible@NotNull default <FR extends ITuple8<? extends P1,? extends P2,? extends P3,? extends P4,? extends P5,? extends P6,? extends P7,? extends P8>,FP1,FP2> Predicate2<FP1,FP2> after2(@NotNull java.util.function.BiFunction<FP1,FP2,FR> before)
ITuple8
with matching parametric types
which are applied in their order to this predicate.FR
- function before
's return type, has to be a 8-tuple with matching typesFP1
- function before
's first parameter type, sane for returned predicateFP2
- function before
's second parameter type, same for returned predicatebefore
- function to apply first, has to return a non-null
result so unpacking the parameters
from the tuple is possible@NotNull default <FR extends ITuple8<? extends P1,? extends P2,? extends P3,? extends P4,? extends P5,? extends P6,? extends P7,? extends P8>,FP1,FP2,FP3> Predicate3<FP1,FP2,FP3> after3(@NotNull Function3<FR,FP1,FP2,FP3> before)
ITuple8
with matching parametric types
which are applied in their order to this predicate.FR
- function before
's return type, has to be a 8-tuple with matching typesFP1
- function before
's first parameter type, sane for returned predicateFP2
- function before
's second parameter type, sane for returned predicateFP3
- function before
's third parameter type, sane for returned predicatebefore
- function to apply first, has to return a non-null
result so unpacking the parameters
from the tuple is possible@NotNull default <FR extends ITuple8<? extends P1,? extends P2,? extends P3,? extends P4,? extends P5,? extends P6,? extends P7,? extends P8>,FP1,FP2,FP3,FP4,FP5> Predicate5<FP1,FP2,FP3,FP4,FP5> after5(@NotNull Function5<FR,FP1,FP2,FP3,FP4,FP5> before)
ITuple8
with matching parametric types
which are applied in their order to this function.FR
- function before
's return type, has to be a 8-tuple with matching typesFP1
- function before
's first parameter type, sane for returned predicateFP2
- function before
's second parameter type, sane for returned predicateFP3
- function before
's third parameter type, sane for returned predicateFP4
- function before
's fourth parameter type, sane for returned predicateFP5
- function before
's fifth parameter type, sane for returned predicatebefore
- function to apply first, has to return a non-null
result so unpacking the parameters
from the tuple is possible@NotNull default <FR extends ITuple8<? extends P1,? extends P2,? extends P3,? extends P4,? extends P5,? extends P6,? extends P7,? extends P8>,FP1,FP2,FP3,FP4,FP5,FP6> Predicate6<FP1,FP2,FP3,FP4,FP5,FP6> after6(@NotNull Function6<FR,FP1,FP2,FP3,FP4,FP5,FP6> before)
ITuple8
with matching parametric types
which are applied in their order to this function.FR
- function before
's return type, has to be a 8-tuple with matching typesFP1
- function before
's first parameter type, sane for returned predicateFP2
- function before
's second parameter type, sane for returned predicateFP3
- function before
's third parameter type, sane for returned predicateFP4
- function before
's fourth parameter type, sane for returned predicateFP5
- function before
's fifth parameter type, sane for returned predicateFP6
- function before
's sixth parameter type, sane for returned predicatebefore
- function to apply first, has to return a non-null
result so unpacking the parameters
from the tuple is possible@NotNull default <FR extends ITuple8<? extends P1,? extends P2,? extends P3,? extends P4,? extends P5,? extends P6,? extends P7,? extends P8>,FP1,FP2,FP3,FP4,FP5,FP6,FP7> Predicate7<FP1,FP2,FP3,FP4,FP5,FP6,FP7> after7(@NotNull Function7<FR,FP1,FP2,FP3,FP4,FP5,FP6,FP7> before)
ITuple8
with matching parametric types
which are applied in their order to this predicate.FR
- function before
's return type, has to be a 8-tuple with matching typesFP1
- function before
's first parameter type, sane for returned predicateFP2
- function before
's second parameter type, sane for returned predicateFP3
- function before
's third parameter type, sane for returned predicateFP4
- function before
's fourth parameter type, sane for returned predicateFP5
- function before
's fifth parameter type, sane for returned predicateFP6
- function before
's sixth parameter type, sane for returned predicateFP7
- function before
's seventh parameter type, sane for returned predicatebefore
- function to apply first, has to return a non-null
result so unpacking the parameters
from the tuple is possible@NotNull default <FR extends ITuple8<? extends P1,? extends P2,? extends P3,? extends P4,? extends P5,? extends P6,? extends P7,? extends P8>,FP1,FP2,FP3,FP4,FP5,FP6,FP7,FP8> Predicate8<FP1,FP2,FP3,FP4,FP5,FP6,FP7,FP8> after8(@NotNull Function8<FR,FP1,FP2,FP3,FP4,FP5,FP6,FP7,FP8> before)
ITuple8
with matching parametric types
which are applied in their order to this predicate.FR
- function before
's return type, has to be a 8-tuple with matching typesFP1
- function before
's first parameter type, sane for returned predicateFP2
- function before
's second parameter type, sane for returned predicateFP3
- function before
's third parameter type, sane for returned predicateFP4
- function before
's fourth parameter type, sane for returned predicateFP5
- function before
's fifth parameter type, sane for returned predicateFP6
- function before
's sixth parameter type, sane for returned predicateFP7
- function before
's seventh parameter type, sane for returned predicateFP8
- function before
's seventh parameter type, sane for returned predicatebefore
- function to apply first, has to return a non-null
result so unpacking the parameters
from the tuple is possible@NotNull default <FR extends ITuple8<? extends P1,? extends P2,? extends P3,? extends P4,? extends P5,? extends P6,? extends P7,? extends P8>,FP1,FP2,FP3,FP4,FP5,FP6,FP7,FP8,FP9> Predicate9<FP1,FP2,FP3,FP4,FP5,FP6,FP7,FP8,FP9> after9(@NotNull Function9<FR,FP1,FP2,FP3,FP4,FP5,FP6,FP7,FP8,FP9> before)
ITuple8
with matching parametric types
which are applied in their order to this predicate.FR
- function before
's return type, has to be a 8-tuple with matching typesFP1
- function before
's first parameter type, sane for returned predicateFP2
- function before
's second parameter type, sane for returned predicateFP3
- function before
's third parameter type, sane for returned predicateFP4
- function before
's fourth parameter type, sane for returned predicateFP5
- function before
's fifth parameter type, sane for returned predicateFP6
- function before
's sixth parameter type, sane for returned predicateFP7
- function before
's seventh parameter type, sane for returned predicateFP8
- function before
's seventh parameter type, sane for returned predicateFP9
- function before
's ninth parameter type, sane for returned predicatebefore
- function to apply first, has to return a non-null
result so unpacking the parameters
from the tuple is possible