T1 - type of object used as the source of the data to compareT2 - type of object being comparedpublic class StrategyIndirectedPredicate<T1,T2> extends Object implements com.google.common.base.Predicate<T1>
Object returned by a lookup function
against an injected predicate.| Modifier and Type | Field and Description |
|---|---|
private com.google.common.base.Function<T1,T2> |
objectLookupStrategy
Lookup strategy for object.
|
private com.google.common.base.Predicate<T2> |
predicate
Predicate to apply to indirected object.
|
| Constructor and Description |
|---|
StrategyIndirectedPredicate(com.google.common.base.Function<T1,T2> objectStrategy,
Collection<T2> collection)
Constructor that simplifies constructing a test for containment in a collection, which
is a common use case.
|
StrategyIndirectedPredicate(com.google.common.base.Function<T1,T2> objectStrategy,
com.google.common.base.Predicate<T2> pred)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
apply(T1 input) |
static <T1,T2> StrategyIndirectedPredicate<T1,T2> |
forCollection(com.google.common.base.Function<T1,T2> objectStrategy,
Collection<T2> collection)
Factory method for collection-based constructor.
|
static <T1,T2> StrategyIndirectedPredicate<T1,T2> |
forPredicate(com.google.common.base.Function<T1,T2> objectStrategy,
com.google.common.base.Predicate<T2> pred)
Factory method for predicate-based constructor.
|
@Nonnull private final com.google.common.base.Function<T1,T2> objectLookupStrategy
public StrategyIndirectedPredicate(@Nonnull com.google.common.base.Function<T1,T2> objectStrategy, @Nonnull com.google.common.base.Predicate<T2> pred)
objectStrategy - lookup strategy for objectpred - the predicate to applypublic StrategyIndirectedPredicate(@Nonnull com.google.common.base.Function<T1,T2> objectStrategy, @Nonnull Collection<T2> collection)
objectStrategy - lookup strategy for objectcollection - a collection to test for containmentpublic boolean apply(@Nullable T1 input)
apply in interface com.google.common.base.Predicate<T1>@Nonnull public static <T1,T2> StrategyIndirectedPredicate<T1,T2> forPredicate(@Nonnull com.google.common.base.Function<T1,T2> objectStrategy, @Nonnull com.google.common.base.Predicate<T2> pred)
T1 - type of object used as the source of the data to compareT2 - type of object being comparedobjectStrategy - the lookup strategy for objectpred - the predicate to apply@Nonnull public static <T1,T2> StrategyIndirectedPredicate<T1,T2> forCollection(@Nonnull com.google.common.base.Function<T1,T2> objectStrategy, @Nonnull Collection<T2> collection)
T1 - type of object used as the source of the data to compareT2 - type of object being comparedobjectStrategy - the lookup strategy for objectcollection - a collection to test for containmentCopyright © 1999–2019 Shibboleth Consortium. All rights reserved.