Interface QuickFilterRuleType
- All Superinterfaces:
DescriptionProvider,NameProvider
- All Known Implementing Classes:
AbstractQuickFilterRuleType,HasLabelRuleType,InProjectRuleType,LastExecutionDateRuleType,LastResultStatusRuleType,NameMatcherRuleType,QuickFilterRuleTypeUnsafeCodeDecorator,SuspensionStatusRuleType
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 Summary
Modifier and TypeMethodDescriptionvoidaddDefaults(@NotNull Map<String, Object> configuration) Add defaults to quick filter rule configuration.Return all configuration keys which should be persisted for a quick filter rule of this type.@Nullable StringDescription of this rule type.@Nullable StringgetEditHtml(@NotNull Map<String, Object> configuration) Get rendered HTML snippet for editing configuration of this rule type.@NotNull StringgetKey()Complete plugin module key of this rule type.@NotNull StringgetName()Name of this rule type.booleanmatches(@NotNull Map<String, Object> configuration, @NotNull ImmutableTopLevelPlan plan) Checks whether the given plan matches a rule of this type with given configuration.@NotNull ErrorCollectionValidate configuration of a rule of this type.
-
Method Details
-
getKey
Complete plugin module key of this rule type. -
getName
Name of this rule type.- Specified by:
getNamein interfaceDescriptionProvider- Specified by:
getNamein interfaceNameProvider
-
getDescription
Description of this rule type.- Specified by:
getDescriptionin interfaceDescriptionProvider
-
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
Add defaults to quick filter rule configuration.- Parameters:
configuration- rule configuration; the values may only be strings or lists of strings
-
validate
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 stringsplan- plan to test- Returns:
- true if plan matches this rule, false otherwise
-
getEditHtml
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
-