Interface QuickFilterRuleType

All Superinterfaces:
DescriptionProvider, NameProvider
All Known Implementing Classes:
AbstractQuickFilterRuleType, HasLabelRuleType, InProjectRuleType, LastExecutionDateRuleType, LastResultStatusRuleType, NameMatcherRuleType, QuickFilterRuleTypeUnsafeCodeDecorator, SuspensionStatusRuleType

public interface QuickFilterRuleType extends DescriptionProvider

A type of a QuickFilterRule which can be used within a QuickFilter.

Instances of this class should be stateless or at least immutable, as they only represent a type of rule, not the rule itself. All methods invoked on a rule type always pass rules's state as arguments. It is possible that only one instance of each rule type class will be created and shared throughout Bamboo.

  • Method Details

    • getKey

      @NotNull @NotNull String getKey()
      Complete plugin module key of this rule type.
    • getName

      @NotNull @NotNull String getName()
      Name of this rule type.
      Specified by:
      getName in interface DescriptionProvider
      Specified by:
      getName in interface NameProvider
    • getDescription

      @Nullable @Nullable String getDescription()
      Description of this rule type.
      Specified by:
      getDescription in interface DescriptionProvider
    • getConfigurationKeys

      @NotNull @NotNull Set<String> getConfigurationKeys()
      Return all configuration keys which should be persisted for a quick filter rule of this type. If this rule type doesn't require any configuration, return an empty set. Only values of these keys from rule's configuration will be persisted. Keys not found in rule's configuration will be skipped.
    • addDefaults

      void addDefaults(@NotNull @NotNull Map<String,Object> configuration)
      Add defaults to quick filter rule configuration.
      Parameters:
      configuration - rule configuration; the values may only be strings or lists of strings
    • validate

      @NotNull @NotNull ErrorCollection validate(@NotNull @NotNull Map<String,Object> configuration)
      Validate configuration of a rule of this type. Return an empty error collection if the configuration is valid.
      Parameters:
      configuration - rule configuration; the values may only be strings or lists of strings
    • matches

      boolean matches(@NotNull @NotNull Map<String,Object> configuration, @NotNull @NotNull ImmutableTopLevelPlan plan)
      Checks whether the given plan matches a rule of this type with given configuration.
      Parameters:
      configuration - rule configuration; the values may only be strings or lists of strings
      plan - plan to test
      Returns:
      true if plan matches this rule, false otherwise
    • getEditHtml

      @Nullable @Nullable String getEditHtml(@NotNull @NotNull Map<String,Object> configuration)
      Get rendered HTML snippet for editing configuration of this rule type. Return null if this rule doesn't require configuration by user.
      Parameters:
      configuration - configuration of this rule, might be empty (but still non null) on initial call; the values may only be strings or lists of strings