Class AbstractRepositoryRequest.AbstractBuilder<B extends AbstractRepositoryRequest.AbstractBuilder<B>>
java.lang.Object
com.atlassian.bitbucket.util.BuilderSupport
com.atlassian.bitbucket.repository.AbstractRepositoryRequest.AbstractBuilder<B>
- Type Parameters:
B
- The builder class, used to control the return type on builder methods to provide a fluent API
- Direct Known Subclasses:
RepositoryCreateRequest.Builder
,RepositoryForkRequest.Builder
,RepositoryUpdateRequest.Builder
- Enclosing class:
- AbstractRepositoryRequest
public abstract static class AbstractRepositoryRequest.AbstractBuilder<B extends AbstractRepositoryRequest.AbstractBuilder<B>>
extends BuilderSupport
Base class for creating builders for
repository
-related requests.-
Field Summary
Fields inherited from class com.atlassian.bitbucket.util.BuilderSupport
NOT_BLANK
-
Constructor Summary
ModifierConstructorDescriptionprotected
protected
AbstractBuilder
(AbstractRepositoryRequest request) protected
AbstractBuilder
(Repository repository) -
Method Summary
Modifier and TypeMethodDescriptiondescription
(String value) Sets the description of the repository.forkable
(boolean value) Sets whether the request should mark the repository forkable or not.Sets the name to be used for the request.publiclyAccessible
(boolean value) protected abstract B
self()
Overridden in concrete builder implementations to returnthis
.Methods inherited from class com.atlassian.bitbucket.util.BuilderSupport
addIf, addIf, addIf, addIf, addIf, addIf, checkNotBlank, requireNonBlank
-
Constructor Details
-
AbstractBuilder
protected AbstractBuilder() -
AbstractBuilder
-
AbstractBuilder
-
-
Method Details
-
description
Sets the description of the repository.- Parameters:
value
- the description of the repository- Returns:
this
- Since:
- 6.2
-
forkable
Sets whether the request should mark the repository forkable or not. If this method is not called prior to building the request, its value defaults totrue
and the repository will be forkable by default.- Parameters:
value
-true
to mark the repository as forkable, orfalse
to disable forking- Returns:
this
-
name
Sets the name to be used for the request. The provided value may not benull
, empty or contain only whitespace or an exception will be thrown.Note: This value is required. If this method is not called prior to building the request, an exception will be thrown.
- Parameters:
value
- the name for the repository- Returns:
this
- Throws:
IllegalArgumentException
- if the providedvalue
is empty or contains only whitespaceNullPointerException
- if the providedvalue
isnull
-
publiclyAccessible
- Parameters:
value
- whether the repository will be publicly accessible or not.- Returns:
this
-
self
Overridden in concrete builder implementations to returnthis
.- Returns:
this
-