Class HasLabelRuleType
java.lang.Object
com.atlassian.bamboo.quickfilter.rule.AbstractQuickFilterRuleType
com.atlassian.bamboo.quickfilter.rule.plugin.HasLabelRuleType
- All Implemented Interfaces:
InitablePluginModule<QuickFilterRuleTypeModuleDescriptor>,QuickFilterRuleType,DescriptionProvider,NameProvider,BambooPluginModule
Quick filter rule that filters plans by their labels.
-
Field Summary
Fields inherited from class com.atlassian.bamboo.quickfilter.rule.AbstractQuickFilterRuleType
moduleDescriptor, templateRenderer -
Constructor Summary
ConstructorsConstructorDescriptionHasLabelRuleType(@NotNull TemplateRenderer templateRenderer, @NotNull com.atlassian.struts.TextProvider textProvider, @NotNull LabelManager labelManager) -
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.@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.voidpopulateContextForEdit(@NotNull Map<String, Object> configuration, @NotNull Map<String, Object> context) Populate edit HTML template's context.@NotNull ErrorCollectionValidate configuration of a rule of this type.Methods inherited from class com.atlassian.bamboo.quickfilter.rule.AbstractQuickFilterRuleType
getEditHtml, getKey, initMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.atlassian.bamboo.quickfilter.rule.QuickFilterRuleType
getEditHtml, getKey
-
Constructor Details
-
HasLabelRuleType
@Inject public HasLabelRuleType(@NotNull @NotNull TemplateRenderer templateRenderer, @NotNull @NotNull com.atlassian.struts.TextProvider textProvider, @NotNull @NotNull LabelManager labelManager)
-
-
Method Details
-
getName
Description copied from interface:QuickFilterRuleTypeName of this rule type.- Specified by:
getNamein interfaceDescriptionProvider- Specified by:
getNamein interfaceNameProvider- Specified by:
getNamein interfaceQuickFilterRuleType
-
getDescription
Description copied from interface:QuickFilterRuleTypeDescription of this rule type.- Specified by:
getDescriptionin interfaceDescriptionProvider- Specified by:
getDescriptionin interfaceQuickFilterRuleType
-
getConfigurationKeys
Description copied from interface:QuickFilterRuleTypeReturn 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.- Specified by:
getConfigurationKeysin interfaceQuickFilterRuleType
-
addDefaults
Description copied from interface:QuickFilterRuleTypeAdd defaults to quick filter rule configuration.- Specified by:
addDefaultsin interfaceQuickFilterRuleType- Parameters:
configuration- rule configuration; the values may only be strings or lists of strings
-
validate
@NotNull public @NotNull ErrorCollection validate(@NotNull @NotNull Map<String, Object> configuration) Description copied from interface:QuickFilterRuleTypeValidate configuration of a rule of this type. Return an empty error collection if the configuration is valid.- Specified by:
validatein interfaceQuickFilterRuleType- Parameters:
configuration- rule configuration; the values may only be strings or lists of strings
-
matches
public boolean matches(@NotNull @NotNull Map<String, Object> configuration, @NotNull @NotNull ImmutableTopLevelPlan plan) Description copied from interface:QuickFilterRuleTypeChecks whether the given plan matches a rule of this type with given configuration.- Specified by:
matchesin interfaceQuickFilterRuleType- 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
-
populateContextForEdit
public void populateContextForEdit(@NotNull @NotNull Map<String, Object> configuration, @NotNull @NotNull Map<String, Object> context) Description copied from class:AbstractQuickFilterRuleTypePopulate edit HTML template's context. Will be used inAbstractQuickFilterRuleType.getEditHtml(Map).- Specified by:
populateContextForEditin classAbstractQuickFilterRuleType- Parameters:
configuration- rule configuration; the values may only be strings or lists of stringscontext- initial template's context, might be empty; values may be of any type
-