Class PushCommandParameters.Builder

java.lang.Object
com.atlassian.bitbucket.util.BuilderSupport
com.atlassian.bitbucket.scm.PushCommandParameters.Builder
Enclosing class:
PushCommandParameters

public static class PushCommandParameters.Builder extends BuilderSupport
  • Constructor Details

    • Builder

      public Builder(@Nonnull String remoteUrl)
      Parameters:
      remoteUrl - the URL to push to
    • Builder

      public Builder(@Nonnull PushCommandParameters pushCommandParameters)
      Parameters:
      pushCommandParameters - to copy
  • Method Details

    • anonymous

      @Nonnull public PushCommandParameters.Builder anonymous(boolean value)
      If no credentials are to be provided, set this to true. If no credentials are provided, and anonymous is not set to true, then an IllegalArgumentException will be thrown. Similarly, if credentials are provided, but anonymous is set to true then an IllegalArgumentException will be thrown.
      Parameters:
      value - whether or not the push command should provide credentials
      Returns:
      this
    • build

      @Nonnull public PushCommandParameters build()
    • force

      @Nonnull public PushCommandParameters.Builder force(boolean value)
      Specifies whether to supply --force to force updates to remote refs. Defaults to false.
      Parameters:
      value - whether or not the push command should be forced
      Returns:
      this
    • includePrivateRefs

      @Nonnull public PushCommandParameters.Builder includePrivateRefs(boolean value)
      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

      @Nonnull public PushCommandParameters.Builder password(@Nonnull String value)
      Parameters:
      value - the password to use
      Returns:
      this
    • privateKey

      @Nonnull public PushCommandParameters.Builder privateKey(@Nonnull File value)
      Parameters:
      value - the SSH private key to use for authentication
      Returns:
      this
    • privateKey

      @Nonnull public PushCommandParameters.Builder privateKey(@Nonnull Path value)
      Parameters:
      value - the SSH private key to use for authentication
      Returns:
      this
    • prune

      @Nonnull public PushCommandParameters.Builder prune(boolean value)
      Specifies whether to supply --prune to 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

      @Nonnull public PushCommandParameters.Builder refspecs(@Nonnull Iterable<String> values)
      Parameters:
      values - refspecs to be passed to the push command
      Returns:
      the builder
    • username

      @Nonnull public PushCommandParameters.Builder username(@Nonnull String value)
      Parameters:
      value - the username to use
      Returns:
      this
    • withEnvironment

      @Nonnull public PushCommandParameters.Builder withEnvironment(@Nonnull String name, @Nonnull String value)
      Puts the provided value in the environment map with the specified name, after ensuring both the name and value are not blank.
      Parameters:
      name - the name of the environment variable to set
      value - the value to set for the environment variable
      Returns:
      the builder