Class TagsAction
java.lang.Object
org.jenkinsci.plugins.workflow.actions.TagsAction
- All Implemented Interfaces:
Action,ModelObject,PersistentAction
Tracks arbitrary annotations on FlowNode used for a variety of purposes
This is designed to have a single action on the FlowNode to track all tags, for sanity.
Flexible implementation of JENKINS-26522, with Strings for the annotation.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidAdd a tag key:value pair to this FlowNode, null or empty values are ignored Inputs are CheckForNull so you can directly pass in values without nullchecks upfront.getTags()Get the tag-value mappingsGet the set of tag-value mappings for a nodegetTagValue(String tag) Get the value for a tag, null if not set Input is CheckForNull so you can directly pass in values without nullchecks upfront.static StringgetTagValue(FlowNode node, String tag) Get the value for a tag on a flownode, null if not set (convenience) Input is CheckForNull so you can directly pass in values without nullchecks upfront.booleanRemove a tag mapping Input is CheckForNull so you can directly pass in values without nullchecks upfront.
-
Constructor Details
-
TagsAction
public TagsAction()
-
-
Method Details
-
addTag
Add a tag key:value pair to this FlowNode, null or empty values are ignored Inputs are CheckForNull so you can directly pass in values without nullchecks upfront.- Parameters:
tag- Tag to add to, null or empty values are no-opsvalue- Tag to add to, null or empty values are no-ops
-
removeTag
Remove a tag mapping Input is CheckForNull so you can directly pass in values without nullchecks upfront.- Parameters:
tag- Tag to add to, null or empty values are no-ops- Returns:
- True if we had something to remove, else false
-
getTagValue
Get the value for a tag, null if not set Input is CheckForNull so you can directly pass in values without nullchecks upfront.- Parameters:
tag- Tag of interest to, null or empty values are no-ops- Returns:
- Tag value or null if not set
-
getTags
Get the tag-value mappings- Returns:
- Unmodifiable view of tag-value mappings
-
getTags
Get the set of tag-value mappings for a node- Returns:
- Unmodifiable view of tag-value mappings
-
getTagValue
Get the value for a tag on a flownode, null if not set (convenience) Input is CheckForNull so you can directly pass in values without nullchecks upfront.- Parameters:
tag- Tag of interest to, null or empty values are no-ops- Returns:
- Tag value or null if not set
-
getIconFileName
- Specified by:
getIconFileNamein interfaceAction
-
getDisplayName
- Specified by:
getDisplayNamein interfaceAction- Specified by:
getDisplayNamein interfaceModelObject
-
getUrlName
- Specified by:
getUrlNamein interfaceAction
-