Package jenkins.scm.api
Class SCMHeadCategory
- java.lang.Object
-
- jenkins.scm.api.SCMCategory<SCMHead>
-
- jenkins.scm.api.SCMHeadCategory
-
- Direct Known Subclasses:
ChangeRequestSCMHeadCategory
,TagSCMHeadCategory
,UncategorizedSCMHeadCategory
public abstract class SCMHeadCategory extends SCMCategory<SCMHead>
Base class for categories ofSCMHead
, for example: branches, tags, change requests, mainlines, features, etc.- Since:
- 2.0
-
-
Constructor Summary
Constructors Constructor Description SCMHeadCategory(String urlName, org.jvnet.localizer.Localizable pronoun)
SCMHeadCategory(org.jvnet.localizer.Localizable pronoun)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static List<SCMHeadCategory>
addUncategorizedIfMissing(List<SCMHeadCategory> categories)
Ensures that the supplied list of categories includes theUncategorizedSCMHeadCategory
.static List<SCMHeadCategory>
collect(Iterable<SCMSource> sources)
IteratesSCMSource
instances collecting the unique list ofSCMHeadCategory
instances.static Map<String,SCMHeadCategory>
collectAndSimplify(Iterable<SCMSource> sources)
Collects theSCMHeadCategory
instances from a set ofSCMSource
instances and simplifies the result.protected org.jvnet.localizer.Localizable
defaultDisplayName()
The default display name.static Map<String,SCMHeadCategory>
simplify(Iterable<SCMHeadCategory> categories)
Simplifies a collection ofSCMHeadCategory
replacing duplicates with theirunion(List)
.static SCMHeadCategory
union(List<SCMHeadCategory> 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 Detail
-
SCMHeadCategory
public SCMHeadCategory(@CheckForNull org.jvnet.localizer.Localizable pronoun)
-
SCMHeadCategory
public SCMHeadCategory(@NonNull String urlName, @CheckForNull org.jvnet.localizer.Localizable pronoun)
-
-
Method Detail
-
collect
@NonNull public static List<SCMHeadCategory> collect(@NonNull Iterable<SCMSource> sources)
IteratesSCMSource
instances collecting the unique list ofSCMHeadCategory
instances.- Parameters:
sources
- theSCMSource
instances to iterate.- Returns:
- the list of unique
SCMHeadCategory
instances.
-
addUncategorizedIfMissing
public static List<SCMHeadCategory> addUncategorizedIfMissing(List<SCMHeadCategory> categories)
Ensures that the supplied list of categories includes theUncategorizedSCMHeadCategory
.- Parameters:
categories
- the list ofSCMHeadCategory
instances (must be mutable)- Returns:
- the supplied list for method chaining.
-
union
public static SCMHeadCategory union(List<SCMHeadCategory> categories)
Reduces a list of categories into a single composite category.- Parameters:
categories
- the list of categories (must contain at least one element).- Returns:
- a composite category.
-
simplify
public static Map<String,SCMHeadCategory> simplify(Iterable<SCMHeadCategory> categories)
Simplifies a collection ofSCMHeadCategory
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,SCMHeadCategory> collectAndSimplify(@NonNull Iterable<SCMSource> sources)
Collects theSCMHeadCategory
instances from a set ofSCMSource
instances and simplifies the result.- Parameters:
sources
- theSCMSource
instances- Returns:
- the map of simplified categories keyed by
SCMCategory.getName()
. - See Also:
simplify(Iterable)
,addUncategorizedIfMissing(List)
,SCMCategory.group(Iterable)
,collect(Iterable)
-
defaultDisplayName
@NonNull protected org.jvnet.localizer.Localizable defaultDisplayName()
The default display name.- Specified by:
defaultDisplayName
in classSCMCategory<SCMHead>
- Returns:
- The generic term of a collection of things in this kind of
SCMCategory
.
-
-