C - the type of GitSCMSourceContext so that the SCMSourceContext.withTrait(SCMSourceTrait) etc methods can
be chained easily by subclasses.R - the type of GitSCMSourceRequest produced by newRequest(SCMSource, TaskListener).public class GitSCMSourceContext<C extends GitSCMSourceContext<C,R>,R extends GitSCMSourceRequest> extends jenkins.scm.api.trait.SCMSourceContext<C,R>
SCMSourceContext for a AbstractGitSCMSource.| Modifier and Type | Class and Description |
|---|---|
static class |
GitSCMSourceContext.RefNameMapping |
| Constructor and Description |
|---|
GitSCMSourceContext(jenkins.scm.api.SCMSourceCriteria criteria,
jenkins.scm.api.SCMHeadObserver observer)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
List<org.eclipse.jgit.transport.RefSpec> |
asRefSpecs()
Converts the ref spec templates into
RefSpec instances. |
Collection<GitSCMSourceContext.RefNameMapping> |
getRefNameMappings() |
String |
gitTool()
Returns the name of the
GitTool to use or null to use the default. |
boolean |
ignoreOnPushNotifications()
Returns
true if push notifications should be ignored. |
R |
newRequest(jenkins.scm.api.SCMSource source,
TaskListener listener) |
boolean |
pruneRefs()
Returns
true if the GitSCMSourceRequest needs to be prune aware. |
C |
pruneRefs(boolean include)
Adds a requirement for git ref pruning to any
GitSCMSourceRequest for this context. |
List<String> |
refSpecs()
Returns the list of ref specs to use.
|
String |
remoteName()
Returns the name to give the remote.
|
boolean |
wantBranches()
Returns
true if the GitSCMSourceRequest will need information about branches. |
C |
wantBranches(boolean include)
Adds a requirement for branch details to any
GitSCMSourceRequest for this context. |
C |
wantOtherRef(GitSCMSourceContext.RefNameMapping other)
Adds a requirement for details of additional refs to any
GitSCMSourceRequest for this context. |
boolean |
wantOtherRefs()
Returns
true if the GitSCMSourceRequest will need information about other refs. |
boolean |
wantTags()
Returns
true if the GitSCMSourceRequest will need information about tags. |
C |
wantTags(boolean include)
Adds a requirement for tag details to any
GitSCMSourceRequest for this context. |
C |
withGitTool(String gitTool)
Configures the
ToolInstallation.getName() to use. |
C |
withIgnoreOnPushNotifications(boolean ignoreOnPushNotifications)
Configures whether push notifications should be ignored.
|
C |
withoutRefSpecs()
Clears the specified ref specs.
|
C |
withRefSpec(String refSpec)
Adds the specified ref spec.
|
C |
withRefSpecs(List<String> refSpecs)
Adds the specified ref specs.
|
C |
withRemoteName(String remoteName)
Configures the remote name to use for the git repository.
|
authorities, criteria, filters, observer, prefilters, withAuthority, withCriteria, withFilter, withPrefilter, withTrait, withTraits, withTraitspublic GitSCMSourceContext(@CheckForNull
jenkins.scm.api.SCMSourceCriteria criteria,
@NonNull
jenkins.scm.api.SCMHeadObserver observer)
criteria - (optional) criteria.observer - the SCMHeadObserver.public final boolean wantBranches()
true if the GitSCMSourceRequest will need information about branches.true if the GitSCMSourceRequest will need information about branches.public final boolean wantTags()
true if the GitSCMSourceRequest will need information about tags.true if the GitSCMSourceRequest will need information about tags.public final boolean pruneRefs()
true if the GitSCMSourceRequest needs to be prune aware.true if the GitSCMSourceRequest needs to be prune aware.public final boolean wantOtherRefs()
true if the GitSCMSourceRequest will need information about other refs.true if the GitSCMSourceRequest will need information about other refs.@NonNull public Collection<GitSCMSourceContext.RefNameMapping> getRefNameMappings()
@CheckForNull public final String gitTool()
GitTool to use or null to use the default.GitTool to use or null to use the default.public final boolean ignoreOnPushNotifications()
true if push notifications should be ignored.true if push notifications should be ignored.@NonNull public final List<String> refSpecs()
@NonNull public final String remoteName()
@NonNull public C wantBranches(boolean include)
GitSCMSourceRequest for this context.include - true to add the requirement or false to leave the requirement as is (makes
simpler with method chaining)this for method chaining.@NonNull public C wantTags(boolean include)
GitSCMSourceRequest for this context.include - true to add the requirement or false to leave the requirement as is (makes
simpler with method chaining)this for method chaining.@NonNull public C pruneRefs(boolean include)
GitSCMSourceRequest for this context.include - true to add the requirement or false to leave the requirement as is (makes
simpler with method chaining)this for method chaining.@NonNull public C wantOtherRef(GitSCMSourceContext.RefNameMapping other)
GitSCMSourceRequest for this context.other - The specification for that other refthis for method chaining.@NonNull public final C withGitTool(String gitTool)
ToolInstallation.getName() to use.gitTool - the ToolInstallation.getName() or null to use the system default.this for method chaining.@NonNull public final C withIgnoreOnPushNotifications(boolean ignoreOnPushNotifications)
ignoreOnPushNotifications - true to ignore push notifications.this for method chaining.@NonNull public final C withRefSpec(@NonNull String refSpec)
AbstractGitSCMSource.REF_SPEC_DEFAULT. The ref spec is expected to be processed for substitution of
AbstractGitSCMSource.REF_SPEC_REMOTE_NAME_PLACEHOLDER_STR by AbstractGitSCMSource.getRemote()
before use.refSpec - the ref spec template to add.this for method chaining.withoutRefSpecs()@NonNull public final C withRefSpecs(List<String> refSpecs)
AbstractGitSCMSource.REF_SPEC_DEFAULT. The ref spec is expected to be processed for substitution of
AbstractGitSCMSource.REF_SPEC_REMOTE_NAME_PLACEHOLDER_STR by AbstractGitSCMSource.getRemote()
before use.refSpecs - the ref spec templates to add.this for method chaining.withoutRefSpecs()@NonNull public final C withoutRefSpecs()
AbstractGitSCMSource.REF_SPEC_DEFAULT will be used as the ref spec template.this for method chaining.@NonNull public final C withRemoteName(String remoteName)
remoteName - the remote name to use for the git repository (null or the empty string are
equivalent to passing AbstractGitSCMSource.DEFAULT_REMOTE_NAME).this for method chaining.@NonNull public final List<org.eclipse.jgit.transport.RefSpec> asRefSpecs()
RefSpec instances.RefSpec instances.@NonNull public R newRequest(@NonNull jenkins.scm.api.SCMSource source, TaskListener listener)
newRequest in class jenkins.scm.api.trait.SCMSourceContext<C extends GitSCMSourceContext<C,R>,R extends GitSCMSourceRequest>Copyright © 2007–2020. All rights reserved.