Predicate
interface Predicate<T>
Compat version of java.util.function.Predicate
| Parameters | |
|---|---|
<T> |
the type of the input to the operation |
Summary
Public functions |
|
|---|---|
Predicate<T!>! |
Returns a composed predicate that represents a short-circuiting logical AND of this predicate and another. |
java-static Predicate<T!>! |
Returns a predicate that tests if two arguments are equal according to |
Predicate<T!>! |
negate()Returns a predicate that represents the logical negation of this predicate. |
java-static Predicate<T!>! |
Returns a predicate that is the negation of the supplied predicate. |
Predicate<T!>! |
Returns a composed predicate that represents a short-circuiting logical OR of this predicate and another. |
Boolean |
test(t: T!)Evaluates this predicate on the given argument. |
Public functions
and
fun and(other: Predicate<T!>!): Predicate<T!>!
Returns a composed predicate that represents a short-circuiting logical AND of this predicate and another. When evaluating the composed predicate, if this predicate is false, then the other predicate is not evaluated.
Any exceptions thrown during evaluation of either predicate are relayed to the caller; if evaluation of this predicate throws an exception, the other predicate will not be evaluated.
| Parameters | |
|---|---|
other: Predicate<T!>! |
a predicate that will be logically-ANDed with this predicate |
| Returns | |
|---|---|
Predicate<T!>! |
a composed predicate that represents the short-circuiting logical AND of this predicate and the |
| Throws | |
|---|---|
java.lang.NullPointerException |
if other is null |
isEqual
java-static fun <T> isEqual(targetRef: Any!): Predicate<T!>!
Returns a predicate that tests if two arguments are equal according to equals.
| Parameters | |
|---|---|
<T> |
the type of arguments to the predicate |
targetRef: Any! |
the object reference with which to compare for equality, which may be |
negate
fun negate(): Predicate<T!>!
Returns a predicate that represents the logical negation of this predicate.
| Returns | |
|---|---|
Predicate<T!>! |
a predicate that represents the logical negation of this predicate |
not
java-static fun <T> not(target: Predicate<T!>!): Predicate<T!>!
Returns a predicate that is the negation of the supplied predicate. This is accomplished by returning result of the calling target.negate().
| Parameters | |
|---|---|
<T> |
the type of arguments to the specified predicate |
target: Predicate<T!>! |
predicate to negate |
| Returns | |
|---|---|
Predicate<T!>! |
a predicate that negates the results of the supplied predicate |
| Throws | |
|---|---|
java.lang.NullPointerException |
if target is null |
or
fun or(other: Predicate<T!>!): Predicate<T!>!
Returns a composed predicate that represents a short-circuiting logical OR of this predicate and another. When evaluating the composed predicate, if this predicate is true, then the other predicate is not evaluated.
Any exceptions thrown during evaluation of either predicate are relayed to the caller; if evaluation of this predicate throws an exception, the other predicate will not be evaluated.
| Parameters | |
|---|---|
other: Predicate<T!>! |
a predicate that will be logically-ORed with this predicate |
| Returns | |
|---|---|
Predicate<T!>! |
a composed predicate that represents the short-circuiting logical OR of this predicate and the |
| Throws | |
|---|---|
java.lang.NullPointerException |
if other is null |