Class Disables


  • public final class Disables
    extends java.lang.Object
    Common predicates used for items disabling. Use Predicate.and(Predicate), Predicate.or(Predicate) and Predicate.negate() to build more complex predicates.
    Since:
    09.04.2018
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.util.function.Predicate<ItemInfo> bundle()  
      static java.util.function.Predicate<ItemInfo> dropwizardBundle()
      Note that only directly registered dropwizard bundles are covered.
      static java.util.function.Predicate<ItemInfo> extension()  
      static java.util.function.Predicate<ItemInfo> inPackage​(java.lang.String... pkgs)
      Match packages as "starts with": match all classes in package and subpackages.
      static java.util.function.Predicate<ItemInfo> installer()  
      static java.util.function.Predicate<ItemInfo> itemType​(ConfigItem... types)
      Generic item type predicate.
      static java.util.function.Predicate<ItemInfo> module()
      Note that only directly registered modules are covered.
      static java.util.function.Predicate<ItemInfo> registeredBy​(java.lang.Class<?>... types)
      Check registration source.
      static java.util.function.Predicate<ItemInfo> registeredBy​(ConfigScope... types)
      Shortcut for registeredBy(Class[]) for for special scopes (like classpath scan, bundles lookup etc).
      static java.util.function.Predicate<ItemInfo> registeredBy​(ItemId... scopes)  
      static java.util.function.Predicate<ItemInfo> type​(java.lang.Class<?>... types)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • registeredBy

        public static java.util.function.Predicate<ItemInfo> registeredBy​(ConfigScope... types)
        Shortcut for registeredBy(Class[]) for for special scopes (like classpath scan, bundles lookup etc).
        Parameters:
        types - special scopes
        Returns:
        items registered in specific contexts predicate
      • registeredBy

        public static java.util.function.Predicate<ItemInfo> registeredBy​(ItemId... scopes)
      • itemType

        public static java.util.function.Predicate<ItemInfo> itemType​(ConfigItem... types)
        Generic item type predicate. It could be installer, bundle, extension or module.
        Parameters:
        types - configuration types to match
        Returns:
        items of specific type predicate
      • extension

        public static java.util.function.Predicate<ItemInfo> extension()
        Returns:
        extension item predicate
      • module

        public static java.util.function.Predicate<ItemInfo> module()
        Note that only directly registered modules are covered.
        Returns:
        guice module item predicate
      • bundle

        public static java.util.function.Predicate<ItemInfo> bundle()
        Returns:
        guicey bundle item predicate
      • dropwizardBundle

        public static java.util.function.Predicate<ItemInfo> dropwizardBundle()
        Note that only directly registered dropwizard bundles are covered.
        Returns:
        guicey dropwizard bundle item predicate
      • installer

        public static java.util.function.Predicate<ItemInfo> installer()
        Returns:
        installer item predicate
      • type

        public static java.util.function.Predicate<ItemInfo> type​(java.lang.Class<?>... types)
        Parameters:
        types - target configuration item classes
        Returns:
        exact configuration item types predicate
      • inPackage

        public static java.util.function.Predicate<ItemInfo> inPackage​(java.lang.String... pkgs)
        Match packages as "starts with": match all classes in package and subpackages.
        Parameters:
        pkgs - packages to match (at least one)
        Returns:
        item type package matching predicate