public static class RepositoryUpdateRequest.Builder extends AbstractRepositoryRequest.AbstractBuilder<RepositoryUpdateRequest.Builder>
requests
for updating repositories.forkable, name, publiclyAccessible
NOT_BLANK
Constructor and Description |
---|
Builder() |
Builder(Repository repository)
Constructs a new
Builder which will update the specified Repository . |
Builder(RepositoryUpdateRequest request)
Constructs a new
Builder which uses as its defaults all the values from the provided request. |
Modifier and Type | Method and Description |
---|---|
RepositoryUpdateRequest |
build()
Builds a
request from the assembled values. |
RepositoryUpdateRequest.Builder |
defaultBranch(String value)
Sets the new default branch name to be applied when the repository is updated.
|
RepositoryUpdateRequest.Builder |
id(int value)
Sets the
ID of the repository to be updated. |
RepositoryUpdateRequest.Builder |
project(Project value)
Sets the
project the repository should be moved to. |
protected RepositoryUpdateRequest.Builder |
self()
Overridden in concrete builder implementations to return
this . |
description, forkable, name, publiclyAccessible
addIf, addIf, addIf, addIf, addIf, addIf, checkNotBlank, requireNonBlank
public Builder()
public Builder(@Nonnull Repository repository)
Builder
which will update the specified Repository
. The following values
are copied:
The caller may then change the specific fields they wish to update before building the request. If the
request is built immediately, the repository will not be updated in any way.repository
- the repository to update, and from which all default values should be drawnpublic Builder(@Nonnull RepositoryUpdateRequest request)
Builder
which uses as its defaults all the values from the provided request.request
- the request to copy into the new builder@Nonnull public RepositoryUpdateRequest build()
request
from the assembled values. Before the request is built,
it is first verified that a name
was specified and an exception is thrown if it was
not.IllegalStateException
- if the name
is null
, empty or contains only
whitespace@Nonnull public RepositoryUpdateRequest.Builder defaultBranch(@Nullable String value)
value
- the new default branch name, or null
to retain the existing namethis
@Nonnull public RepositoryUpdateRequest.Builder id(int value)
ID
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.
value
- the repository's IDthis
@Nonnull public RepositoryUpdateRequest.Builder project(Project value)
project
the repository should be moved to.value
- the project to move the repository to. If null
,
leave the repository in the existing project
this
protected RepositoryUpdateRequest.Builder self()
AbstractRepositoryRequest.AbstractBuilder
this
.self
in class AbstractRepositoryRequest.AbstractBuilder<RepositoryUpdateRequest.Builder>
this
Copyright © 2022 Atlassian. All rights reserved.