Package com.atlassian.bitbucket.util
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
,DiffContext.Builder
,DiffStatsSummaryRequest.Builder
,EditFileRequest.Builder
,FileContext.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
,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
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected static <T> void
addIf
(Predicate<? super T> predicate, com.google.common.collect.ImmutableCollection.Builder<T> builder, Iterable<? extends T> values) protected static <T> boolean
addIf
(Predicate<? super T> predicate, com.google.common.collect.ImmutableCollection.Builder<T> builder, T value) protected static <T> void
addIf
(Predicate<? super T> predicate, com.google.common.collect.ImmutableCollection.Builder<T> builder, T value, T... values) protected static <T> void
addIf
(Predicate<? super T> predicate, Collection<T> collection, Iterable<? extends T> values) protected static <T> boolean
addIf
(Predicate<? super T> predicate, Collection<T> collection, T value) protected static <T> void
addIf
(Predicate<? super T> predicate, Collection<T> collection, T value, T... values) protected static String
checkNotBlank
(String value, String name) protected static String
requireNonBlank
(String value, String name)
-
Field Details
-
NOT_BLANK
-
-
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 collectioncollection
- the collection to which elements accepted by the predicate should be addedvalue
- the first element to addvalues
- 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
-
checkNotBlank
-
requireNonBlank
- Parameters:
value
- the value to ensure is notnull
or blank.name
- a name for the value, used in exception messages- Returns:
- the provided
value
, if it is notnull
or blank - Throws:
IllegalArgumentException
- if the providedvalue
is blankNullPointerException
- if the providedvalue
isnull
- Since:
- 4.6
-