Class BuilderSupport

java.lang.Object
com.atlassian.bitbucket.util.BuilderSupport
Direct Known Subclasses:
AbstractBuildStatusSearchRequest.AbstractBuilder, AbstractCommandParameters, AbstractCommitRequest.AbstractCommitRequestBuilder, AbstractCommitsRequest.AbstractCommitsRequestBuilder, AbstractCreateRefRequest.AbstractBuilder, AbstractDiffRequest.AbstractBuilder, AbstractLabelRequest.AbstractBuilder, AbstractProjectRequest.AbstractBuilder, AbstractPullRequestMergeConfigRequest.AbstractBuilder, AbstractPullRequestRequest.AbstractBuilder, AbstractRepositoryHookRequest.AbstractBuilder, AbstractRepositoryRefsRequest.AbstractBuilder, AbstractRepositoryRequest.AbstractBuilder, AbstractServiceUserRequest.AbstractBuilder, AbstractSummary.AbstractBuilder, AddCommentRequest.AbstractBuilder, ArchiveRequest.Builder, BulkCommitsRequest.Builder, BulkTraversalContext.Builder, ChangesetsRequest.Builder, ChangesRequest.Builder, CommentSearchRequest.Builder, CommitDiscussionRequest.Builder, CommonAncestorCommandParameters.Builder, CommonAncestorRequest.Builder, CompareDiffStatsSummaryRequest, ContentTreeContext.Builder, DeleteFilesRequest.Builder, DeleteRecursiveRequest.Builder, DiffContext.Builder, DiffStatsSummaryRequest.Builder, EditFileRequest.Builder, FileContext.Builder, FileExistsRequest.Builder, GenerateGetUrlRequest.Builder, GenerateGetUrlResponse.Builder, GeneratePutUrlRequest.Builder, GeneratePutUrlResponse.Builder, HookScriptCreateRequest.Builder, HookScriptSetConfigurationRequest.Builder, HookScriptUpdateRequest.Builder, IndexSearchRequest.Builder, JobMessageSearchRequest.Builder, JobSearchRequest.Builder, LastModifiedContext.Builder, MailHostConfiguration.Builder, MeshMigrationRequest.Builder, MigrationJobMessageSearchRequest.Builder, PatchRequest.Builder, PullRequestCommitSearchRequest.Builder, PullRequestCreateRequest.AbstractBuilder, PullRequestParticipantRequest.Builder, PullRequestSearchRequest.Builder, PushCommandParameters.Builder, ReadFileRequest.Builder, RefMetadataRequest.Builder, RepositoriesExportRequest.Builder, RepositoryBuildStatusSetRequest.Builder, ResolveCommitsCommandParameters.Builder, ResolveRefRequest.Builder, ResolveRefsRequest.Builder, ReviewerGroupCreateRequest.Builder, ReviewerGroupUpdateRequest.Builder, SetFilePermissionRequest.Builder, SetPermissionRequest.Builder, SignedObjectsParameters.Builder, SimpleMinimalCommit.AbstractMinimalCommitBuilder, SimplePropertySupport.AbstractPropertyBuilder, SimpleRefChangeDetails.Builder, SimpleRescopeDetails.Builder, SuggestPullRequestsRequest.Builder, TraversalContext.Builder, TraversalRequest.Builder

public class BuilderSupport extends Object
  • Field Details

  • Constructor Details

    • BuilderSupport

      public BuilderSupport()
  • Method Details

    • addIf

      protected static <T> boolean addIf(@Nonnull Predicate<? super T> predicate, @Nonnull Collection<T> collection, @Nullable T value)
    • addIf

      protected static <T> boolean addIf(@Nonnull Predicate<? super T> predicate, @Nonnull com.google.common.collect.ImmutableCollection.Builder<T> builder, @Nullable T value)
    • addIf

      @SafeVarargs protected static <T> void addIf(@Nonnull Predicate<? super T> predicate, @Nonnull Collection<T> collection, @Nullable T value, @Nullable T... values)
      Type Parameters:
      T - type for the builder
      Parameters:
      predicate - verifies elements prior to adding them to the collection
      collection - the collection to which elements accepted by the predicate should be added
      value - the first element to add
      values - a varargs array containing 0 or more elements to add after the first
    • addIf

      @SafeVarargs protected static <T> void addIf(@Nonnull Predicate<? super T> predicate, @Nonnull com.google.common.collect.ImmutableCollection.Builder<T> builder, @Nullable T value, @Nullable T... values)
    • addIf

      protected static <T> void addIf(@Nonnull Predicate<? super T> predicate, @Nonnull Collection<T> collection, @Nullable Iterable<? extends T> values)
    • addIf

      protected static <T> void addIf(@Nonnull Predicate<? super T> predicate, @Nonnull com.google.common.collect.ImmutableCollection.Builder<T> builder, @Nullable Iterable<? extends T> values)
    • checkNotBlank

      @Nonnull protected static String checkNotBlank(@Nullable String value, @Nullable String name)
    • requireNonBlank

      @Nonnull protected static String requireNonBlank(@Nullable String value, @Nullable String name)
      Parameters:
      value - the value to ensure is not null or blank.
      name - a name for the value, used in exception messages
      Returns:
      the provided value, if it is not null or blank
      Throws:
      IllegalArgumentException - if the provided value is blank
      NullPointerException - if the provided value is null
      Since:
      4.6