net.shibboleth.utilities.java.support.logic
Class AnyMatchPredicate<T>

java.lang.Object
  extended by net.shibboleth.utilities.java.support.logic.AnyMatchPredicate<T>
Type Parameters:
T - type of object upon which this predicate operates
All Implemented Interfaces:
com.google.common.base.Predicate<Iterable<T>>

public class AnyMatchPredicate<T>
extends Object
implements com.google.common.base.Predicate<Iterable<T>>

A Predicate that checks that any item in an Iterable matches a given target predicate. If the given Iterable is null or contains no items this method will return false, otherwise it passes each Iterable value to the target predicate, even if those values are null. The first true returned by the target predicate stops evaluation and causes this predicate to return (i.e., it short-circuits the evaluation).


Field Summary
private  com.google.common.base.Predicate<T> predicate
          The predicate applied to each value of the Iterable.
 
Constructor Summary
AnyMatchPredicate(com.google.common.base.Predicate<T> target)
          Constructor.
 
Method Summary
 boolean apply(Iterable<T> inputs)
          
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.google.common.base.Predicate
equals
 

Field Detail

predicate

private final com.google.common.base.Predicate<T> predicate
The predicate applied to each value of the Iterable.

Constructor Detail

AnyMatchPredicate

public AnyMatchPredicate(@Nonnull
                         com.google.common.base.Predicate<T> target)
Constructor.

Parameters:
target - the target predicate against which all Iterable elements are evaluated
Method Detail

apply

public boolean apply(@Nullable
                     Iterable<T> inputs)

Specified by:
apply in interface com.google.common.base.Predicate<Iterable<T>>


Copyright © 1999-2012. All Rights Reserved.