Class RepositoryUpdateRequest.Builder
java.lang.Object
com.atlassian.bitbucket.util.BuilderSupport
com.atlassian.bitbucket.repository.AbstractRepositoryRequest.AbstractBuilder<RepositoryUpdateRequest.Builder>
com.atlassian.bitbucket.repository.RepositoryUpdateRequest.Builder
- Enclosing class:
- RepositoryUpdateRequest
public static class RepositoryUpdateRequest.Builder
extends AbstractRepositoryRequest.AbstractBuilder<RepositoryUpdateRequest.Builder>
Constructs
requests
for updating repositories.-
Field Summary
Fields inherited from class com.atlassian.bitbucket.util.BuilderSupport
NOT_BLANK
-
Constructor Summary
ConstructorDescriptionBuilder()
Builder
(Repository repository) Constructs a newBuilder
which will update the specifiedRepository
.Builder
(RepositoryUpdateRequest request) Constructs a newBuilder
which uses as its defaults all the values from the provided request. -
Method Summary
Modifier and TypeMethodDescriptionarchived
(boolean value) Sets thearchive state
of the repository when it is updated.build()
Builds arequest
from the assembled values.defaultBranch
(String value) Sets the new default branch name to be applied when the repository is updated.id
(int value) Sets theID
of the repository to be updated.Sets theproject
the repository should be moved to.protected RepositoryUpdateRequest.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
Constructs a newBuilder
which will update the specifiedRepository
. The following values are copied:Repository.getId()
->
id(int)
Repository.getName()
->
AbstractRepositoryRequest.AbstractBuilder.name(String)
Repository.isArchived()
->
archived(boolean)
Repository.isForkable()
->
AbstractRepositoryRequest.AbstractBuilder.forkable(boolean)
Repository.isPublic()
->
AbstractRepositoryRequest.AbstractBuilder.publiclyAccessible(boolean)
- Parameters:
repository
- the repository to update, and from which all default values should be drawn
-
Builder
Constructs a newBuilder
which uses as its defaults all the values from the provided request.- Parameters:
request
- the request to copy into the new builder
-
-
Method Details
-
build
Builds arequest
from the assembled values.- Returns:
- the built request
-
archived
Sets thearchive state
of the repository when it is updated.- Parameters:
value
-true
if the repository has been archived,false
otherwise.- Returns:
this
- Since:
- 8.0
-
defaultBranch
Sets the new default branch name to be applied when the repository is updated. If a default branch name is not specified it will not be updated.- Parameters:
value
- the new default branch name, ornull
to retain the existing name- Returns:
this
- Since:
- 7.5
-
id
Sets theID
of the repository to be updated.Note: This value is required. If the ID specified does not match an existing repository, or if this method is not called prior to
building
, an exception will be thrown when attempting to perform the update.- Parameters:
value
- the repository's ID- Returns:
this
-
project
Sets theproject
the repository should be moved to.- Parameters:
value
- the project to move the repository to. Ifnull
, leave the repository in the existingproject
- Returns:
this
-
self
Description copied from class:AbstractRepositoryRequest.AbstractBuilder
Overridden in concrete builder implementations to returnthis
.- Specified by:
self
in classAbstractRepositoryRequest.AbstractBuilder<RepositoryUpdateRequest.Builder>
- Returns:
this
-