L
- the left argument type.R
- the right argument type.public final class BinaryFunctionBinaryPredicate<L,R> extends Object implements BinaryPredicate<L,R>
Constructor and Description |
---|
BinaryFunctionBinaryPredicate(BinaryFunction<? super L,? super R,Boolean> function)
Create an
BinaryPredicate wrapping the given
BinaryFunction . |
public BinaryFunctionBinaryPredicate(BinaryFunction<? super L,? super R,Boolean> function)
BinaryPredicate
wrapping the given
BinaryFunction
.function
- the BinaryFunction
to wrappublic boolean test(L left, R right)
boolean
value of the
non-null
Boolean
returned by the
evaluate
method of my underlying
function.
The mehod throws NullPointerException if the underlying function returns
null
, and
ClassCastException if the underlying function returns a
non-Boolean
test
in interface BinaryPredicate<L,R>
left
- the L element of the ordered pair of argumentsright
- the R element of the ordered pair of argumentspublic static <L,R,T> BinaryFunctionBinaryPredicate<L,R> adapt(BinaryFunction<? super L,? super R,Boolean> function)
null
, BinaryFunction
to the BinaryPredicate
interface.
When the given BinaryFunction
is null
, returns
null
.L
- left typeR
- right typeT
- result typefunction
- the possibly-null
BinaryFunction
to adaptBinaryFunctionBinaryPredicate
wrapping the given
BinaryFunction
, or null
if the given
BinaryFunction
is null
Copyright © 2003–2014 The Apache Software Foundation. All rights reserved.