net.sf.staccatocommons.defs.predicate
Interface Predicate2<A,B>

All Superinterfaces:
Applicable<A,Predicate<B>>, Applicable2<A,B,Boolean>, Evaluable2<A,B>, NullSafeAware<Predicate2<A,B>>

public interface Predicate2<A,B>
extends Evaluable2<A,B>, Applicable2<A,B,Boolean>, Applicable<A,Predicate<B>>, NullSafeAware<Predicate2<A,B>>

A rich Evaluable2

Author:
flbulgarelli

Method Summary
 Predicate2<A,B> and(Evaluable2<? super A,? super B> other)
          Returns a predicate that performs a short-circuit logical-and between this Predicate2's Evaluable2.eval(Object,Object) and other
 Predicate2<A,B> not()
          Negates this Predicate
 Predicate2<A,B> nullSafe()
          Answers a Predicate2 that returns true if both arguments are null, false if only one of them is null, or evalutes this predicate, otherwise.
 Predicate2<A,B> or(Evaluable2<? super A,? super B> other)
          Returns a predicate that, performs a short-circuit logical-or between this Predicate2's Evaluable2.eval(Object,Object) and other
 Predicate<Tuple2<A,B>> uncurry()
          Uncurries this predicate, by returning a Predicate that takes a single pair, being its components each of the original predicate parameters
 
Methods inherited from interface net.sf.staccatocommons.defs.Evaluable2
eval
 
Methods inherited from interface net.sf.staccatocommons.defs.Applicable2
apply
 
Methods inherited from interface net.sf.staccatocommons.defs.Applicable
apply
 

Method Detail

not

Predicate2<A,B> not()
Negates this Predicate

Returns:
a Predicate2 that negates this Predicate2's result.

or

Predicate2<A,B> or(@NonNull
                   Evaluable2<? super A,? super B> other)
Returns a predicate that, performs a short-circuit logical-or between this Predicate2's Evaluable2.eval(Object,Object) and other

Parameters:
other - another Evaluable2. Non null.
Returns:
A new predicate that performs the short circuited or between this and other when evaluated.

and

Predicate2<A,B> and(@NonNull
                    Evaluable2<? super A,? super B> other)
Returns a predicate that performs a short-circuit logical-and between this Predicate2's Evaluable2.eval(Object,Object) and other

Parameters:
other - another Evaluable2. Non null.
Returns:
A new predicate that performs the short circuited logical-and between this and other when evaluated. Non Null

nullSafe

@NullSafe
Predicate2<A,B> nullSafe()
Answers a Predicate2 that returns true if both arguments are null, false if only one of them is null, or evalutes this predicate, otherwise.

Specified by:
nullSafe in interface NullSafeAware<Predicate2<A,B>>
Returns:
a new null-safe Applicable of type A. Non null.

uncurry

Predicate<Tuple2<A,B>> uncurry()
Uncurries this predicate, by returning a Predicate that takes a single pair, being its components each of the original predicate parameters

Returns:
a new Predicate


Get Staccatocommons at SourceForge.net. Fast, secure and Free Open Source software downloads