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
ConstructorsConstructorDescriptionBuilder()Builder(Repository repository) Constructs a newBuilderwhich will update the specifiedRepository.Builder(RepositoryUpdateRequest request) Constructs a newBuilderwhich uses as its defaults all the values from the provided request. -
Method Summary
Modifier and TypeMethodDescriptionarchived(boolean value) Sets thearchive stateof the repository when it is updated.build()Builds arequestfrom the assembled values.defaultBranch(String value) Sets the new default branch name to be applied when the repository is updated.id(int value) Sets theIDof the repository to be updated.Sets theprojectthe repository should be moved to.protected RepositoryUpdateRequest.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
Constructs a newBuilderwhich 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 newBuilderwhich 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 arequestfrom the assembled values.- Returns:
- the built request
-
archived
Sets thearchive stateof the repository when it is updated.- Parameters:
value-trueif the repository has been archived,falseotherwise.- 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, ornullto retain the existing name- Returns:
this- Since:
- 7.5
-
id
Sets theIDof 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 theprojectthe 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.AbstractBuilderOverridden in concrete builder implementations to returnthis.- Specified by:
selfin classAbstractRepositoryRequest.AbstractBuilder<RepositoryUpdateRequest.Builder>- Returns:
this
-