Class RepositoryCreateRequest.Builder
java.lang.Object
com.atlassian.bitbucket.util.BuilderSupport
com.atlassian.bitbucket.repository.AbstractRepositoryRequest.AbstractBuilder<RepositoryCreateRequest.Builder>
com.atlassian.bitbucket.repository.RepositoryCreateRequest.Builder
- Enclosing class:
- RepositoryCreateRequest
public static class RepositoryCreateRequest.Builder
extends AbstractRepositoryRequest.AbstractBuilder<RepositoryCreateRequest.Builder>
Constructs
requests
for creating new repositories.-
Field Summary
Fields inherited from class com.atlassian.bitbucket.util.BuilderSupport
NOT_BLANK
-
Constructor Summary
ConstructorDescriptionBuilder()
Builder
(Repository repository) Builder
(RepositoryCreateRequest request) -
Method Summary
Modifier and TypeMethodDescriptionbuild()
Builds arequest
from the assembled values.defaultBranch
(String value) Sets the default branch name to be applied when the repository is created.Sets the project in which the repository will be created.Sets the SCM to be used by the new repository.protected RepositoryCreateRequest.Builder
self()
Overridden in concrete builder implementations to returnthis
.Methods inherited from class com.atlassian.bitbucket.repository.AbstractRepositoryRequest.AbstractBuilder
description, forkable, name, publiclyAccessible
Methods inherited from class com.atlassian.bitbucket.util.BuilderSupport
addIf, addIf, addIf, addIf, addIf, addIf, checkNotBlank, requireNonBlank
-
Constructor Details
-
Builder
public Builder() -
Builder
-
Builder
-
-
Method Details
-
build
Builds arequest
from the assembled values. Before the request is built, it is first verified that aproject
andSCM ID
were specified, and an exception is thrown if either are missing.- Returns:
- the built request
- Throws:
IllegalStateException
- if theSCM ID
is blank (empty, or containing only whitespace), or theproject(Project)
isnull
-
defaultBranch
Sets the default branch name to be applied when the repository is created. If a default branch name is not specified, repository creation will fall back on the instance- or SCM-level default, in that order.- Parameters:
value
- the default branch name, ornull
to use the instance- or SCM-level default- Returns:
this
- Since:
- 7.5
-
project
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 providedvalue
isnull
-
scmId
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 providedvalue
is empty or contains only whitespaceNullPointerException
- if the providedvalue
isnull
-
self
Description copied from class:AbstractRepositoryRequest.AbstractBuilder
Overridden in concrete builder implementations to returnthis
.- Specified by:
self
in classAbstractRepositoryRequest.AbstractBuilder<RepositoryCreateRequest.Builder>
- Returns:
this
-