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.
  • Constructor Details

    • AbstractBuilder

      protected AbstractBuilder()
    • AbstractBuilder

      protected AbstractBuilder(@Nonnull Repository repository)
    • AbstractBuilder

      protected AbstractBuilder(@Nonnull AbstractRepositoryRequest request)
  • Method Details

    • description

      @Nonnull public B description(@Nullable String value)
      Sets the description of the repository.
      Parameters:
      value - the description of the repository
      Returns:
      this
      Since:
      6.2
    • forkable

      @Nonnull public B forkable(boolean value)
      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 to true and the repository will be forkable by default.
      Parameters:
      value - true to mark the repository as forkable, or false to disable forking
      Returns:
      this
    • name

      @Nonnull public B name(@Nonnull String value)
      Sets the name to be used for the request. The provided value may not be null, 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 provided value is empty or contains only whitespace
      NullPointerException - if the provided value is null
    • publiclyAccessible

      @Nonnull public B publiclyAccessible(boolean value)
      Parameters:
      value - whether the repository will be publicly accessible or not.
      Returns:
      this
    • self

      protected abstract B self()
      Overridden in concrete builder implementations to return this.
      Returns:
      this