Package jenkins.scm.api
Class SCMSourceCategory
- Direct Known Subclasses:
UncategorizedSCMSourceCategory
Base class for categories of
SCMSource
, for example: repository, depot, VOB, etc.- Since:
- 2.0
-
Constructor Summary
ConstructorDescriptionSCMSourceCategory
(String urlName, org.jvnet.localizer.Localizable pronoun) SCMSourceCategory
(org.jvnet.localizer.Localizable pronoun) -
Method Summary
Modifier and TypeMethodDescriptionstatic List<SCMSourceCategory>
addUncategorizedIfMissing
(List<SCMSourceCategory> categories) Ensures that the supplied list of categories includes theUncategorizedSCMSourceCategory
.static List<SCMSourceCategory>
collect
(Iterable<SCMNavigator> navigators) IteratesSCMNavigator
instances collecting the unique list ofSCMSourceCategory
instances.static Map<String,
SCMSourceCategory> collectAndSimplify
(Iterable<SCMNavigator> navigators) Collects theSCMSourceCategory
instances from a set ofSCMNavigator
instances and simplifies the result.protected org.jvnet.localizer.Localizable
The default display name.static Map<String,
SCMSourceCategory> simplify
(Iterable<SCMSourceCategory> categories) Simplifies a collection ofSCMSourceCategory
replacing duplicates with theirunion(List)
.static SCMSourceCategory
union
(List<SCMSourceCategory> categories) Reduces a list of categories into a single composite category.Methods inherited from class jenkins.scm.api.SCMCategory
getDisplayName, getName, group, group, isMatch, isMatch, isUncategorized, toDisplayName, toDisplayName, toShortUrl, toShortUrl
-
Constructor Details
-
SCMSourceCategory
public SCMSourceCategory(@CheckForNull org.jvnet.localizer.Localizable pronoun) -
SCMSourceCategory
public SCMSourceCategory(@NonNull String urlName, @CheckForNull org.jvnet.localizer.Localizable pronoun)
-
-
Method Details
-
collect
IteratesSCMNavigator
instances collecting the unique list ofSCMSourceCategory
instances.- Parameters:
navigators
- theSCMNavigator
instances to iterate.- Returns:
- the list of unique
SCMHeadCategory
instances.
-
addUncategorizedIfMissing
Ensures that the supplied list of categories includes theUncategorizedSCMSourceCategory
.- Parameters:
categories
- the list ofSCMSourceCategory
instances (must be mutable)- Returns:
- the supplied list for method chaining.
-
union
Reduces a list of categories into a single composite category.- Parameters:
categories
- the list of categories.- Returns:
- a composite category.
-
simplify
Simplifies a collection ofSCMSourceCategory
replacing duplicates with theirunion(List)
.- Parameters:
categories
- the collection of categories to simplify.- Returns:
- the map of simplified categories keyed by
SCMCategory.getName()
.
-
collectAndSimplify
public static Map<String,SCMSourceCategory> collectAndSimplify(@NonNull Iterable<SCMNavigator> navigators) Collects theSCMSourceCategory
instances from a set ofSCMNavigator
instances and simplifies the result.- Parameters:
navigators
- theSCMNavigator
instances- Returns:
- the map of simplified categories keyed by
SCMCategory.getName()
. - See Also:
-
defaultDisplayName
@NonNull protected org.jvnet.localizer.Localizable defaultDisplayName()The default display name.- Specified by:
defaultDisplayName
in classSCMCategory<SCMSource>
- Returns:
- The generic term of a collection of things in this kind of
SCMCategory
.
-