public static class

RepositoryCreateRequest.Builder

extends AbstractRepositoryRequest.AbstractBuilder<B extends AbstractBuilder<B>>
java.lang.Object
   ↳ com.atlassian.bitbucket.util.BuilderSupport
     ↳ com.atlassian.bitbucket.repository.AbstractRepositoryRequest.AbstractBuilder<B extends com.atlassian.bitbucket.repository.AbstractRepositoryRequest.AbstractBuilder<B>>
       ↳ com.atlassian.bitbucket.repository.RepositoryCreateRequest.Builder

Class Overview

Constructs requests for creating new repositories.

Summary

[Expand]
Inherited Fields
From class com.atlassian.bitbucket.repository.AbstractRepositoryRequest.AbstractBuilder
From class com.atlassian.bitbucket.util.BuilderSupport
Public Constructors
Builder()
Builder(Repository repository)
Builder(RepositoryCreateRequest request)
Public Methods
@Nonnull RepositoryCreateRequest build()
Builds a request from the assembled values.
@Nonnull RepositoryCreateRequest.Builder project(Project value)
Sets the project in which the repository will be created.
@Nonnull RepositoryCreateRequest.Builder scmId(String value)
Sets the SCM to be used by the new repository.
Protected Methods
RepositoryCreateRequest.Builder self()
Overridden in concrete builder implementations to return this.
[Expand]
Inherited Methods
From class com.atlassian.bitbucket.repository.AbstractRepositoryRequest.AbstractBuilder
From class com.atlassian.bitbucket.util.BuilderSupport
From class java.lang.Object

Public Constructors

public Builder ()

public Builder (Repository repository)

public Builder (RepositoryCreateRequest request)

Public Methods

@Nonnull public RepositoryCreateRequest build ()

Builds a request from the assembled values. Before the request is built, it is first verified that a name, project and SCM ID were specified, and an exception is thrown if any are missing.

Returns
  • the built request
Throws
IllegalStateException if the name or SCM ID are blank (empty, or containing only whitespace), or the project(Project) is null

@Nonnull public RepositoryCreateRequest.Builder project (Project value)

Sets the project in which the repository will be created.

Note: This value is required. If this method is not called prior to building the request, an exception will be thrown.

Parameters
value the destination project
Returns
  • this
Throws
NullPointerException if the provided value is null

@Nonnull public RepositoryCreateRequest.Builder scmId (String value)

Sets the SCM to be used by the new repository.

Note: This value is required. If this method is not called prior to building the request, an exception will be thrown.

Parameters
value the SCM used to handle the repository
Returns
  • this
Throws
IllegalArgumentException if the provided value is empty or contains only whitespace
NullPointerException if the provided value is null

Protected Methods

protected RepositoryCreateRequest.Builder self ()

Overridden in concrete builder implementations to return this.

Returns
  • this