View Javadoc
1   package com.atlassian.plugin.predicate;
2   
3   import com.atlassian.plugin.ModuleDescriptor;
4   import com.atlassian.plugin.PluginAccessor;
5   
6   /**
7    * A {@link ModuleDescriptorPredicate} that matches enabled modules.
8    */
9   public class EnabledModulePredicate<T> implements ModuleDescriptorPredicate<T> {
10      public EnabledModulePredicate() {
11      }
12  
13      /**
14       * @deprecated Since 3.1.0, use {@link #EnabledModulePredicate()} instead.
15       */
16      @Deprecated
17      public EnabledModulePredicate(final PluginAccessor pluginAccessor) {
18      }
19  
20      public boolean matches(final ModuleDescriptor<? extends T> moduleDescriptor) {
21          return moduleDescriptor.isEnabled() && !moduleDescriptor.isBroken();
22      }
23  }