public class

Predicates

extends Object
java.lang.Object
   ↳ com.atlassian.jira.util.Predicates

Summary

Nested Classes
class Predicates.And<T>  
class Predicates.Composite<T>  
class Predicates.FalsePredicate<T> A predicate that always returns false. 
class Predicates.Or<T>  
class Predicates.TruePredicate<T> A predicate that always returns true. 
Public Constructors
Predicates()
Public Methods
static <T> Predicate<T> allOf(Predicate<? super T> left, Predicate<? super T> right)
Create a composite predicate that evaluates to true when both the passed predicates evaluate to true.
static <T> Predicate<T> anyOf(Predicate<? super T> left, Predicate<? super T> right)
Create a composite predicate that evaluates to true when one the passed predicates evaluate to true.
static <T> Predicate<T> equalTo(T check)
A predicate that check that some input equals the passed argument.
static <T> Predicate<T> falsePredicate()
Return a predicate that always returns false.
static <T> Predicate<T> isInstanceOf(Class<? extends T> clazz)
static <T> Predicate<T> isNull()
A predicate that check that the input is null.
static <T> Predicate<T> not(Predicate<? super T> predicate)
Create a predicate that inverts the behaviour of the passed predicate.
static <T> Predicate<T> notNull()
A predicate that check that the input is not null.
static <T> Predicate<T> truePredicate()
Return a predicate that always returns true.
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public Predicates ()

Public Methods

public static Predicate<T> allOf (Predicate<? super T> left, Predicate<? super T> right)

Create a composite predicate that evaluates to true when both the passed predicates evaluate to true.

Parameters
left the first predicate.
right the second predicate.
Returns
  • a composite predicate that is only true when both the passed predicates evaluate to true.

public static Predicate<T> anyOf (Predicate<? super T> left, Predicate<? super T> right)

Create a composite predicate that evaluates to true when one the passed predicates evaluate to true.

Parameters
left the first predicate.
right the second predicate.
Returns
  • a composite predicate that is only true when both the passed predicates evaluate to true.

public static Predicate<T> equalTo (T check)

A predicate that check that some input equals the passed argument.

Parameters
check the element to check equality of, must not be null.
Returns
  • a Predicate that will return true if the input matches the argument.

public static Predicate<T> falsePredicate ()

Return a predicate that always returns false.

Returns
  • a predicate that always returns false.

public static Predicate<T> isInstanceOf (Class<? extends T> clazz)

public static Predicate<T> isNull ()

A predicate that check that the input is null.

Returns
  • a Predicate that will return true if the input is null.

public static Predicate<T> not (Predicate<? super T> predicate)

Create a predicate that inverts the behaviour of the passed predicate.

Parameters
predicate the predicate to negate. Cannot be null.
Returns
  • a predicate that inverts the behaviour of the passed predicate.

public static Predicate<T> notNull ()

A predicate that check that the input is not null.

Returns
  • a Predicate that will return true if the input is not null.

public static Predicate<T> truePredicate ()

Return a predicate that always returns true.

Returns
  • a predicate that always returns true.