Class JobInfoHelpers
java.lang.Object
org.jenkinsci.plugins.github.util.JobInfoHelpers
Utility class which holds converters or predicates (matchers) to filter or convert job lists
- Since:
- 1.12.0
- Author:
- lanwen (Merkushev Kirill)
-
Method Summary
Modifier and TypeMethodDescriptionstatic <T extends Job>
ParameterizedJobMixInasParameterizedJobMixIn
(T job) Converts any child class ofJob
(such asAbstractProject
toParameterizedJobMixIn
to use it for workflowstatic <ITEM extends Item>
com.google.common.base.Function<ITEM, Collection<GitHubRepositoryName>> static <ITEM extends Item>
com.google.common.base.Predicate<ITEM> isAlive()
If any of event subscriber interested in hook for item, then return true By default, push hook subscriber is interested in job with gh-push-triggerstatic <ITEM extends Item>
com.google.common.base.Predicate<ITEM> Can be useful to ignore disabled jobs on reregistering hooksstatic <T extends Trigger>
TtriggerFrom
(Item item, Class<T> tClass) static <T extends Trigger>
TtriggerFrom
(Job<?, ?> job, Class<T> tClass) Deprecated.static <ITEM extends Item>
com.google.common.base.Predicate<ITEM> withTrigger
(Class<? extends Trigger> clazz)
-
Method Details
-
withTrigger
public static <ITEM extends Item> com.google.common.base.Predicate<ITEM> withTrigger(Class<? extends Trigger> clazz) - Parameters:
clazz
- trigger class to check in job- Returns:
- predicate with true on apply if job contains trigger of given class
-
isBuildable
Can be useful to ignore disabled jobs on reregistering hooks- Returns:
- predicate with true on apply if item is buildable
-
associatedNames
public static <ITEM extends Item> com.google.common.base.Function<ITEM,Collection<GitHubRepositoryName>> associatedNames()- Returns:
- function which helps to convert job to repo names associated with this job
-
isAlive
If any of event subscriber interested in hook for item, then return true By default, push hook subscriber is interested in job with gh-push-trigger- Returns:
- predicate with true if item alive and should have hook
-
triggerFrom
@Deprecated @CheckForNull public static <T extends Trigger> T triggerFrom(Job<?, ?> job, Class<T> tClass) Deprecated.- Type Parameters:
T
- type of trigger- Parameters:
job
- job to search trigger intClass
- trigger with class which we want to receive from job- Returns:
- Trigger instance with required class or null TODO use standard method in 1.621+
-
triggerFrom
- Type Parameters:
T
- type of trigger- Parameters:
item
- job to search trigger intClass
- trigger with class which we want to receive from job- Returns:
- Trigger instance with required class or null
- Since:
- 1.25.0 TODO use standard method in 1.621+
-
asParameterizedJobMixIn
Converts any child class ofJob
(such asAbstractProject
toParameterizedJobMixIn
to use it for workflow- Type Parameters:
T
- any child type of Job- Parameters:
job
- to wrap- Returns:
- ParameterizedJobMixIn TODO use standard method in 1.621+
-
triggerFrom(Item, Class)