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
ConstructorsConstructorDescriptionBuilder()Builder(Repository repository) Builder(RepositoryCreateRequest request) -
Method Summary
Modifier and TypeMethodDescriptionbuild()Builds arequestfrom 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.Builderself()Overridden in concrete builder implementations to returnthis.Methods inherited from class com.atlassian.bitbucket.repository.AbstractRepositoryRequest.AbstractBuilder
description, forkable, name, publiclyAccessibleMethods 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 arequestfrom the assembled values. Before the request is built, it is first verified that aprojectandSCM IDwere specified, and an exception is thrown if either are missing.- Returns:
- the built request
- Throws:
IllegalStateException- if theSCM IDis 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, ornullto 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
buildingthe request, an exception will be thrown.- Parameters:
value- the destination project- Returns:
this- Throws:
NullPointerException- if the providedvalueisnull
-
scmId
Sets the SCM to be used by the new repository.Note: This value is required. If this method is not called prior to
buildingthe request, an exception will be thrown.- Parameters:
value- the SCM used to handle the repository- Returns:
this- Throws:
IllegalArgumentException- if the providedvalueis empty or contains only whitespaceNullPointerException- if the providedvalueisnull
-
self
Description copied from class:AbstractRepositoryRequest.AbstractBuilderOverridden in concrete builder implementations to returnthis.- Specified by:
selfin classAbstractRepositoryRequest.AbstractBuilder<RepositoryCreateRequest.Builder>- Returns:
this
-