Package org.jenkinsci.plugins.gitclient
Class GitURIRequirementsBuilder
java.lang.Object
org.jenkinsci.plugins.gitclient.GitURIRequirementsBuilder
A builder to help creating requirements from GIT URIs.
- Since:
- 1.2.0
-
Method Summary
Modifier and TypeMethodDescriptionList<com.cloudbees.plugins.credentials.domains.DomainRequirement>
build()
Builds the list of requirements.static GitURIRequirementsBuilder
create()
Creates an empty builder.Creates a new builder with the same requirements as this builder.static GitURIRequirementsBuilder
Creates a new builder using the supplied URI.withHostname
(String hostname) Replace any hostname requirements with the supplied hostname.withHostnamePort
(String hostname, int port) Replace any hostname or hostname:port requirements with the supplied hostname and port.Removes any hostname or hostname:port requirements.Removes any hostname:port requirements.Removes any path requirements.Removes any scheme requirements.Replace any path requirements with the supplied path.withScheme
(String scheme) Replace any scheme requirements with the supplied scheme.Replaces the requirements with those of the supplied URI.
-
Method Details
-
create
Creates an empty builder.- Returns:
- a new empty builder.
-
duplicate
Creates a new builder with the same requirements as this builder.- Returns:
- a new builder with the same requirements as this builder.
-
fromUri
Creates a new builder using the supplied URI.- Parameters:
uri
- the URI to create the requirements of.- Returns:
- a new builder with the requirements of the supplied URI.
-
withUri
Replaces the requirements with those of the supplied URI.- Parameters:
uri
- the URI.- Returns:
this
.
-
withoutScheme
Removes any scheme requirements.- Returns:
this
.
-
withoutPath
Removes any path requirements.- Returns:
this
.
-
withoutHostname
Removes any hostname or hostname:port requirements.- Returns:
this
.
-
withoutHostnamePort
Removes any hostname:port requirements.- Returns:
this
.
-
withScheme
Replace any scheme requirements with the supplied scheme.- Parameters:
scheme
- the scheme to use as a requirement- Returns:
this
.
-
withPath
Replace any path requirements with the supplied path.- Parameters:
path
- to use as a requirement- Returns:
this
.
-
withHostname
Replace any hostname requirements with the supplied hostname.- Parameters:
hostname
- the hostname to use as a requirement- Returns:
this
.
-
withHostnamePort
Replace any hostname or hostname:port requirements with the supplied hostname and port.- Parameters:
hostname
- the hostname to use as a requirement or (@code null} to not add any requirementport
- the port or-1
to not addHostnamePortRequirement
s- Returns:
this
.
-
build
Builds the list of requirements.- Returns:
- the list of requirements.
-