public static class RepositoryCreateRequest.Builder extends AbstractRepositoryRequest.AbstractBuilder<RepositoryCreateRequest.Builder>
requests
for creating new repositories.NOT_BLANK
Constructor and Description |
---|
Builder() |
Builder(Repository repository) |
Builder(RepositoryCreateRequest request) |
Modifier and Type | Method and Description |
---|---|
RepositoryCreateRequest |
build()
Builds a
request from the assembled values. |
RepositoryCreateRequest.Builder |
defaultBranch(String value)
Sets the default branch name to be applied when the repository is created.
|
RepositoryCreateRequest.Builder |
project(Project value)
Sets the project in which the repository will be created.
|
RepositoryCreateRequest.Builder |
scmId(String value)
Sets the SCM to be used by the new repository.
|
protected RepositoryCreateRequest.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)
public Builder(@Nonnull RepositoryCreateRequest request)
@Nonnull public RepositoryCreateRequest build()
request
from the assembled values. Before the request is built,
it is first verified that a project
and SCM ID
were specified,
and an exception is thrown if either are missing.IllegalStateException
- if the SCM ID
is blank (empty, or containing only
whitespace), or the project(Project)
is null
@Nonnull public RepositoryCreateRequest.Builder defaultBranch(@Nullable String value)
value
- the default branch name, or null
to use the instance- or SCM-level defaultthis
@Nonnull public RepositoryCreateRequest.Builder project(@Nonnull Project value)
Note: This value is required. If this method is not called prior to building
the
request, an exception will be thrown.
value
- the destination projectthis
NullPointerException
- if the provided value
is null
@Nonnull public RepositoryCreateRequest.Builder scmId(@Nonnull String value)
Note: This value is required. If this method is not called prior to building
the
request, an exception will be thrown.
value
- the SCM used to handle the repositorythis
IllegalArgumentException
- if the provided value
is empty or contains only whitespaceNullPointerException
- if the provided value
is null
protected RepositoryCreateRequest.Builder self()
AbstractRepositoryRequest.AbstractBuilder
this
.self
in class AbstractRepositoryRequest.AbstractBuilder<RepositoryCreateRequest.Builder>
this
Copyright © 2024 Atlassian. All rights reserved.