final class Branches
Manages the branches of a Pipeline.
- This type ensures that the branch properties implement the org.zowe.jenkins_shared_library.pipelines.base.interfaces.BranchProperties
interface and all branches are of the same property.Type | Name and description |
---|---|
java.lang.Class<T> |
propertyClass The class object used to instantiate a new branch value. |
Constructor and description |
---|
Branches
(java.lang.Class<T> propertyClass) Constructs the class with the specified factory class. |
Type Params | Return Type | Name and description |
---|---|---|
|
T |
add(T branch) Adds a branch object as protected. |
|
void |
add(java.util.List<T> branches) Adds a list of branches to the map. |
|
T |
addMap(java.util.Map branch) Add a branch map into the object. |
|
void |
addMap(java.util.List<java.util.Map> branches) Adds a list of branches to the protected maps. |
|
T |
get(java.lang.String branchName) Gets a protected branch's properties from the map. |
|
T |
getByPattern(java.lang.String branchName) Gets a protected branch's properties from the map by name pattern. |
|
boolean |
isProtected(java.lang.String branchName) Checks if a given branch name is protected. |
|
T |
remove(java.lang.String branchName) Removes a branch from the protected list. |
Methods inherited from class | Name |
---|---|
class java.lang.Object |
java.lang.Object#wait(long, int), java.lang.Object#wait(long), java.lang.Object#wait(), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll() |
The class object used to instantiate a new branch value.
Constructs the class with the specified factory class.
propertyClass
- The class that is used to instantiate a new property object.Adds a branch object as protected.
branch
- The properties of a branch that is protected.Adds a list of branches to the map.
branches
- The branches to add as protected.Add a branch map into the object. This map must follow the syntax of the Groovy Map Object Constructor.
branch
- The branch to add.Adds a list of branches to the protected maps. The elements of the list must follow the syntax of the Groovy Map Object Constructor.
branches
- The branches to add as protected.Gets a protected branch's properties from the map. @Note: This method is used to access the property based on raw branch name or name pattern. Usually we should use getByPattern(String) to find the branch properties.
branchName
- The name or the pattern of the branch to retrieveGets a protected branch's properties from the map by name pattern. @Note: This is the recommended method to find a branch property.
branchName
- The name of the branch to retrieveChecks if a given branch name is protected.
branchName
- The name of the branch to check.Removes a branch from the protected list.
branchName
- The name of the branch to remove.Groovy Documentation