Package net.shibboleth.shared.resolver

# Class ResolverSupport

java.lang.Object
net.shibboleth.shared.resolver.ResolverSupport

public final class ResolverSupport extends Object
Support class for resolver implementations.

## Constructor Summary

Constructors
Modifier
Constructor
Description
`private`
`ResolverSupport()`
Constructor.

## Method Summary

Modifier and Type
Method
Description
`static <T> Iterable<T>`
`getFilteredIterable(Iterable<T> candidates, Set<Predicate<T>> predicates, boolean satisfyAny, boolean onEmptyPredicatesReturnEmpty)`
Return a filtered `Iterable` of the specified candidates based on the supplied set of `Predicate` and the satisfyAny flag.
`static <T, E extends Predicate<T>>
Set<Predicate<T>>`
`getPredicates(CriteriaSet criteriaSet, Class<E> predicateCriterionType, CriterionPredicateRegistry<T> registry)`
Obtain a set of `Predicate` based on a `CriteriaSet`.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Constructor Details

### ResolverSupport

private ResolverSupport()
Constructor.

## Method Details

### getPredicates

@Nonnull public static <T, E extends Predicate<T>> Set<Predicate<T>> getPredicates(@Nullable CriteriaSet criteriaSet, @Nullable Class<E> predicateCriterionType, @Nullable CriterionPredicateRegistry<T> registry) throws ResolverException
Obtain a set of `Predicate` based on a `CriteriaSet`.

Type Parameters:
  `T` - the type of target which the returned predicates can evaluate
  `E` - the type of criterion predicates to extract directly from the criteria set
Parameters:
  `criteriaSet` - the criteria set to evaluate
  `predicateCriterionType` - the optional type to evaluate and extract directly from the criteria set
  `registry` - the optional registry of mappings from `Criterion` to `Predicate`
Returns:
  a set of predicates, possibly empty
Throws:
  `ResolverException` - if there is a fatal error evaluating the criteria set

### getFilteredIterable

@Nonnull public static <T> Iterable<T> getFilteredIterable(@Nullable Iterable<T> candidates, @Nullable Set<Predicate<T>> predicates, boolean satisfyAny, boolean onEmptyPredicatesReturnEmpty)
Return a filtered `Iterable` of the specified candidates based on the supplied set of `Predicate` and the satisfyAny flag.

Type Parameters:
  `T` - the type of target candidates
Parameters:
  `candidates` - the candidates to filter
  `predicates` - the predicates with which to filter
  `satisfyAny` - if true the predicates will be logically OR-ed, otherwise they are logically AND-ed
  `onEmptyPredicatesReturnEmpty` - if true and no predicates are supplied, then return an empty iterable; otherwise return the original input candidates
Returns:
  the filtered iteration of the candidates