Package com.atlassian.bitbucket.scm
Class PushCommandParameters.Builder
java.lang.Object
com.atlassian.bitbucket.util.BuilderSupport
com.atlassian.bitbucket.scm.PushCommandParameters.Builder
- Enclosing class:
- PushCommandParameters
-
Field Summary
Fields inherited from class com.atlassian.bitbucket.util.BuilderSupport
NOT_BLANK -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionanonymous(boolean value) If no credentials are to be provided, set this totrue.build()force(boolean value) Specifies whether to supply--forceto force updates to remote refs.includePrivateRefs(boolean value) If an explicit refspec is set then this setting is ignored.privateKey(File value) privateKey(Path value) prune(boolean value) Specifies whether to supply--pruneto prune remote branches and tags where the local branch or tag has been deleted.withEnvironment(String name, String value) Puts the providedvaluein theenvironmentmap with the specifiedname, after ensuring both thenameandvalueare not blank.Methods inherited from class com.atlassian.bitbucket.util.BuilderSupport
addIf, addIf, addIf, addIf, addIf, addIf, checkNotBlank, requireNonBlank
-
Constructor Details
-
Builder
- Parameters:
remoteUrl- the URL to push to
-
Builder
- Parameters:
pushCommandParameters- to copy
-
-
Method Details
-
anonymous
If no credentials are to be provided, set this totrue. If no credentials are provided, and anonymous is not set totrue, then anIllegalArgumentExceptionwill be thrown. Similarly, if credentials are provided, but anonymous is set totruethen anIllegalArgumentExceptionwill be thrown.- Parameters:
value- whether or not the push command should provide credentials- Returns:
this
-
build
-
force
Specifies whether to supply--forceto force updates to remote refs. Defaults tofalse.- Parameters:
value- whether or not the push command should be forced- Returns:
this
-
includePrivateRefs
If an explicit refspec is set then this setting is ignored.- Parameters:
value- whether to include private refs (outside refs/heads and refs/tags) in the push. The default value is true so all refs will be pushed.- Returns:
this
-
password
- Parameters:
value- the password to use- Returns:
this
-
privateKey
- Parameters:
value- the SSH private key to use for authentication- Returns:
this
-
privateKey
- Parameters:
value- the SSH private key to use for authentication- Returns:
this
-
prune
Specifies whether to supply--pruneto prune remote branches and tags where the local branch or tag has been deleted.- Parameters:
value- true if pruning should be enabled- Returns:
- the builder
-
refspecs
- Parameters:
values- refspecs to be passed to the push command- Returns:
- the builder
-
username
- Parameters:
value- the username to use- Returns:
this
-
withEnvironment
@Nonnull public PushCommandParameters.Builder withEnvironment(@Nonnull String name, @Nonnull String value) Puts the providedvaluein theenvironmentmap with the specifiedname, after ensuring both thenameandvalueare not blank.- Parameters:
name- the name of the environment variable to setvalue- the value to set for the environment variable- Returns:
- the builder
-