Class Disables
- java.lang.Object
-
- ru.vyarus.dropwizard.guice.module.context.Disables
-
public final class Disables extends java.lang.Object
Common predicates used for items disabling. UsePredicate.and(Predicate)
,Predicate.or(Predicate)
andPredicate.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 forregisteredBy(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)
-
-
-
Method Detail
-
registeredBy
public static java.util.function.Predicate<ItemInfo> registeredBy(ConfigScope... types)
Shortcut forregisteredBy(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(java.lang.Class<?>... types)
Check registration source. Context class could beApplication
,ClasspathScanner
,GuiceyBundleLookup
and classes implementingGuiceyBundle
.- Parameters:
types
- context class types- Returns:
- items registered in specific contexts predicate
- See Also:
for the list of all special 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
-
-