public final class Filters
extends java.lang.Object
ConfigurationInfo.getItems(ConfigItem, Predicate) and
ConfigurationInfo.getItems(Predicate).
Use Predicate.and(Predicate), Predicate.or(Predicate) and Predicate.negate()
to reuse default filters.| Modifier and Type | Method and Description |
|---|---|
static <T extends BundleItemInfo> |
bundles()
Guicey and dropwizard bundles are pretty much unified and likely to be queried together for reporting.
|
static <T extends ItemInfo> |
disabledBy(java.lang.Class<?> type)
Shortcut for
disabledBy(ItemId). |
static <T extends ItemInfo> |
disabledBy(ItemId scope)
Filter for items disabled in specified scope.
|
static <T extends ItemInfo> |
enabled()
Filter for enabled items.
|
static java.util.function.Predicate<ExtensionItemInfo> |
fromBinding()
Filter for extensions detected from guice bindings.
|
static <T extends ItemInfo> |
fromScan()
Filter for items registered with classpath scan.
|
static java.util.function.Predicate<ExtensionItemInfo> |
installedBy(java.lang.Class<? extends FeatureInstaller> type)
Filter for extensions installed by specified installer.
|
static java.util.function.Predicate<GuiceyBundleItemInfo> |
lookupBundles()
Filter for bundles resolved by lookup mechanism.
|
static java.util.function.Predicate<ModuleItemInfo> |
overridingModule()
Filter for overriding modules.
|
static <T extends ItemInfo> |
registeredBy(java.lang.Class<?> type)
Shortcut for
registeredBy(ItemId) for scope classes. |
static <T extends ItemInfo> |
registeredBy(ConfigScope specialScope)
Shortcut for
registeredBy(ItemId) for special scopes (like classpath scan, bundles lookup etc). |
static <T extends ItemInfo> |
registeredBy(ItemId scope)
In contrast to
registrationScope(ItemId) this filter returns item for all scopes mentioned item
(including scopes where registration was considered duplicate). |
static <T extends ItemInfo> |
registrationScope(java.lang.Class<?> type)
Shortcut for
registrationScope(ItemId). |
static <T extends ItemInfo> |
registrationScope(ConfigScope specialScope)
Shortcut for
registrationScope(ItemId) for special scopes (like classpath scan, bundles lookup etc). |
static <T extends ItemInfo> |
registrationScope(ItemId scope)
Filter for items registered by specified context.
|
static java.util.function.Predicate<BundleItemInfo> |
transitiveBundles()
Filter for transitive bundles: bundles registered only by other bundles (and never directly).
|
static <T extends ItemInfo> |
type(java.lang.Class<?> type)
Filter used for instance items (bundle, module) selection by type.
|
static <T extends ItemInfo> |
type(ConfigItem... types)
Filter used for multi-type searches to filter out item types.
|
public static <T extends ItemInfo> java.util.function.Predicate<T> enabled()
DisableSupport).
Items not supporting disable considered enabled (so it's safe to apply filter for
all items).T - expected info container type (if used within single configuration type)public static <T extends ItemInfo> java.util.function.Predicate<T> disabledBy(ItemId scope)
DisableSupport).
Items not supporting disable considered enabled (so it's safe to apply filter for
all items).T - expected info container type (if used within single configuration type)scope - target scopepublic static <T extends ItemInfo> java.util.function.Predicate<T> disabledBy(java.lang.Class<?> type)
disabledBy(ItemId).T - expected info container type (if used within single configuration type)type - target scope typepublic static <T extends ItemInfo> java.util.function.Predicate<T> fromScan()
ScanSupport. Items not supporting scan are considered not resolved by scan
(so it's safe to apply filter for all items).T - expected info container type (if used within single configuration type)public static <T extends ItemInfo> java.util.function.Predicate<T> registrationScope(ItemId scope)
Application, ClasspathScanner,
GuiceyBundleLookup and
classes implementing GuiceyBundle.
Safe to apply filter for all items.
Note: counts only actual registration, ignoring duplicate (rejected) registrations
(see registeredBy(Class) for filter counting all registrations).
Note: if scope key contain class only (without instance identity) and multiple scope instances were registered, then all object from all instance scopes will be returned.
T - expected info container type (if used within single configuration type)scope - scope classfor the list of all special scopespublic static <T extends ItemInfo> java.util.function.Predicate<T> registrationScope(ConfigScope specialScope)
registrationScope(ItemId) for special scopes (like classpath scan, bundles lookup etc).T - expected info container type (if used within single configuration type)specialScope - special scope typepublic static <T extends ItemInfo> java.util.function.Predicate<T> registrationScope(java.lang.Class<?> type)
registrationScope(ItemId).
Note: if type is a bundle type and multiple bundle instances were registered, then all registered items from all bundle instances will be returned (will affect multiple scopes).
T - expected info container type (if used within single configuration type)type - scope typepublic static <T extends ItemInfo> java.util.function.Predicate<T> registeredBy(ItemId scope)
registrationScope(ItemId) this filter returns item for all scopes mentioned item
(including scopes where registration was considered duplicate).T - expected info container type (if used within single configuration type)scope - scope keyfor the list of all special scopespublic static <T extends ItemInfo> java.util.function.Predicate<T> registeredBy(ConfigScope specialScope)
registeredBy(ItemId) for special scopes (like classpath scan, bundles lookup etc).T - expected info container type (if used within single configuration type)specialScope - special scope typepublic static <T extends ItemInfo> java.util.function.Predicate<T> registeredBy(java.lang.Class<?> type)
registeredBy(ItemId) for scope classes.T - expected info container type (if used within single configuration type)type - scope classpublic static <T extends ItemInfo> java.util.function.Predicate<T> type(ConfigItem... types)
Predicate.negate().T - expected info container type (if used within single configuration type)types - item types to matchpublic static <T extends ItemInfo> java.util.function.Predicate<T> type(java.lang.Class<?> type)
T - expected info container type (if used within single configuration type)type - item classpublic static java.util.function.Predicate<GuiceyBundleItemInfo> lookupBundles()
ConfigItem.Bundle items.public static java.util.function.Predicate<BundleItemInfo> transitiveBundles()
public static <T extends BundleItemInfo> java.util.function.Predicate<T> bundles()
T - expected info container type (if used within single configuration type)public static java.util.function.Predicate<ExtensionItemInfo> installedBy(java.lang.Class<? extends FeatureInstaller> type)
ConfigItem.Extension items.type - installer classpublic static java.util.function.Predicate<ExtensionItemInfo> fromBinding()
ConfigItem.Extension items.public static java.util.function.Predicate<ModuleItemInfo> overridingModule()
ConfigItem.Module items.