Class Filters

    • Method Detail

      • enabled

        public static <T extends ItemInfo> java.util.function.Predicate<T> enabled()
        Filter for enabled items. Not all items support disable (DisableSupport). Items not supporting disable considered enabled (so it's safe to apply filter for all items).
        Type Parameters:
        T - expected info container type (if used within single configuration type)
        Returns:
        enabled items filter
      • disabledBy

        public static <T extends ItemInfo> java.util.function.Predicate<T> disabledBy​(ItemId scope)
        Filter for items disabled in specified scope. Not all items support disable (DisableSupport). Items not supporting disable considered enabled (so it's safe to apply filter for all items).
        Type Parameters:
        T - expected info container type (if used within single configuration type)
        Parameters:
        scope - target scope
        Returns:
        items disabled in scope filter
      • disabledBy

        public static <T extends ItemInfo> java.util.function.Predicate<T> disabledBy​(java.lang.Class<?> type)
        Shortcut for disabledBy(ItemId).
        Type Parameters:
        T - expected info container type (if used within single configuration type)
        Parameters:
        type - target scope type
        Returns:
        items disabled in scope filter
      • fromScan

        public static <T extends ItemInfo> java.util.function.Predicate<T> fromScan()
        Filter for items registered with classpath scan. Not all items support classpath scan ScanSupport. Items not supporting scan are considered not resolved by scan (so it's safe to apply filter for all items).
        Type Parameters:
        T - expected info container type (if used within single configuration type)
        Returns:
        items from classpath scan filter
      • registrationScope

        public static <T extends ItemInfo> java.util.function.Predicate<T> registrationScope​(ItemId scope)
        Filter for items registered by specified context. Context class could be 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.

        Type Parameters:
        T - expected info container type (if used within single configuration type)
        Parameters:
        scope - scope class
        Returns:
        items registered in specified context filter
        See Also:
        for the list of all special scopes
      • registrationScope

        public static <T extends ItemInfo> java.util.function.Predicate<T> registrationScope​(ConfigScope specialScope)
        Shortcut for registrationScope(ItemId) for special scopes (like classpath scan, bundles lookup etc).
        Type Parameters:
        T - expected info container type (if used within single configuration type)
        Parameters:
        specialScope - special scope type
        Returns:
        items registered in specified context filter
      • registrationScope

        public static <T extends ItemInfo> java.util.function.Predicate<T> registrationScope​(java.lang.Class<?> type)
        Shortcut for 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).

        Type Parameters:
        T - expected info container type (if used within single configuration type)
        Parameters:
        type - scope type
        Returns:
        items registered in specified context filter
      • registeredBy

        public static <T extends ItemInfo> java.util.function.Predicate<T> registeredBy​(ItemId scope)
        In contrast to registrationScope(ItemId) this filter returns item for all scopes mentioned item (including scopes where registration was considered duplicate).
        Type Parameters:
        T - expected info container type (if used within single configuration type)
        Parameters:
        scope - scope key
        Returns:
        items registered in specified context filter
        See Also:
        for the list of all special scopes
      • registeredBy

        public static <T extends ItemInfo> java.util.function.Predicate<T> registeredBy​(ConfigScope specialScope)
        Shortcut for registeredBy(ItemId) for special scopes (like classpath scan, bundles lookup etc).
        Type Parameters:
        T - expected info container type (if used within single configuration type)
        Parameters:
        specialScope - special scope type
        Returns:
        items registered in specified context filter
      • registeredBy

        public static <T extends ItemInfo> java.util.function.Predicate<T> registeredBy​(java.lang.Class<?> type)
        Shortcut for registeredBy(ItemId) for scope classes.
        Type Parameters:
        T - expected info container type (if used within single configuration type)
        Parameters:
        type - scope class
        Returns:
        items registered in specified context filter
      • type

        public static <T extends ItemInfo> java.util.function.Predicate<T> type​(ConfigItem... types)
        Filter used for multi-type searches to filter out item types. In order to filter out only one type, may be used in conjunction with Predicate.negate().
        Type Parameters:
        T - expected info container type (if used within single configuration type)
        Parameters:
        types - item types to match
        Returns:
        items of type filter
      • type

        public static <T extends ItemInfo> java.util.function.Predicate<T> type​(java.lang.Class<?> type)
        Filter used for instance items (bundle, module) selection by type.
        Type Parameters:
        T - expected info container type (if used within single configuration type)
        Parameters:
        type - item class
        Returns:
        items of class filter
      • lookupBundles

        public static java.util.function.Predicate<GuiceyBundleItemInfo> lookupBundles()
        Filter for bundles resolved by lookup mechanism. Use only for ConfigItem.Bundle items.
        Returns:
        bundles resolved by lookup filter
      • transitiveBundles

        public static java.util.function.Predicate<BundleItemInfo> transitiveBundles()
        Filter for transitive bundles: bundles registered only by other bundles (and never directly). Applied to both guicey and dropwizard bundles.
        Returns:
        transitive bundled filter
      • bundles

        public static <T extends BundleItemInfo> java.util.function.Predicate<T> bundles()
        Guicey and dropwizard bundles are pretty much unified and likely to be queried together for reporting.
        Type Parameters:
        T - expected info container type (if used within single configuration type)
        Returns:
        bundle predicate (guicey or dropwizard)
      • installedBy

        public static java.util.function.Predicate<ExtensionItemInfo> installedBy​(java.lang.Class<? extends FeatureInstaller> type)
        Filter for extensions installed by specified installer. Use only for ConfigItem.Extension items.
        Parameters:
        type - installer class
        Returns:
        extensions installed by specified installer filter
      • fromBinding

        public static java.util.function.Predicate<ExtensionItemInfo> fromBinding()
        Filter for extensions detected from guice bindings. Use only for ConfigItem.Extension items.
        Returns:
        extensions resolved from binding filter
      • overridingModule

        public static java.util.function.Predicate<ModuleItemInfo> overridingModule()
        Filter for overriding modules. Use only for ConfigItem.Module items.
        Returns:
        overriding modules filter