Package com.atlassian.bitbucket.pull
Class PullRequestSearchRequest.Builder
java.lang.Object
com.atlassian.bitbucket.util.BuilderSupport
com.atlassian.bitbucket.pull.PullRequestSearchRequest.Builder
- Enclosing class:
- PullRequestSearchRequest
-
Field Summary
Fields inherited from class com.atlassian.bitbucket.util.BuilderSupport
NOT_BLANK
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
Assembles a newPullRequestSearchRequest
from the provided values.closedSince
(Date value) When set, limits the pull requests to search for pull requests in the closed state (i.e.Limits the search to pull requests that match the specifieddraft
status.filterText
(String value) Limits the search to pull requests where the title or description contains thevalue
.Limits the pull requests to search for by the branch the changes are coming from.fromRefIds
(Iterable<String> values) Limits the pull requests to search for by the branches the changes are coming from.fromRepositoryId
(Integer value) Limits the pull requests to search for by the repository the changes are coming from.order
(PullRequestOrder value) orders
(PullRequestOrder value, PullRequestOrder... values) Specifies a list oforder
's to return the search results in (defaults toNEWEST first
).orders
(Iterable<PullRequestOrder> values) Specifies a list oforder
's to return the search results in (defaults toNEWEST first
).Limits the pull requests to search for by the participants they have.Limits the pull requests to search for by the participants they have.repositoryAndBranch
(PullRequestDirection direction, Integer repositoryId, String branch) Sets the repository and branches fields based on direction, added here as the use case is so common.state
(PullRequestState value) Restricts the search to a specifiedpull request state
.Limits the pull requests to search for by the branches the changes are going to.Limits the pull requests to search for by the branches the changes are going to.toRepositoryId
(Integer value) Limits the pull requests to search for by the repository the changes are going to.updatedSince
(Date value) When set, limits the pull requests to search for pull requests where the updated timestamp is more recent than the specified date.withDescription
(boolean value) withProperties
(boolean value) Methods inherited from class com.atlassian.bitbucket.util.BuilderSupport
addIf, addIf, addIf, addIf, addIf, addIf, checkNotBlank, requireNonBlank
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
build
Assembles a newPullRequestSearchRequest
from the provided values.- Returns:
- a new pull request search request instance
-
closedSince
When set, limits the pull requests to search for pull requests in the closed state (i.e.PullRequestState.MERGED
orPullRequestState.DECLINED
) where the closed timestamp is more recent than the specified date.- Parameters:
value
- the closed since date- Returns:
- the current builder
- Since:
- 4.10
-
draft
Limits the search to pull requests that match the specifieddraft
status.- Parameters:
value
- Iftrue
, then only draft pull requests will be returned. Iffalse
, then only non-draft pull requests will be returned. Ifnull
, then this filter will be ignored.- Returns:
- the current builder
- Since:
- 8.17
-
repositoryAndBranch
@Nonnull public PullRequestSearchRequest.Builder repositoryAndBranch(@Nullable PullRequestDirection direction, @Nullable Integer repositoryId, @Nullable String branch) Sets the repository and branches fields based on direction, added here as the use case is so common.If
OUTGOING
is the direction the from repository and branch are set otherwise the to repository and branch are set.- Parameters:
direction
- the pull request directionrepositoryId
- the repository to restrict bybranch
- the branch to restrict by- Returns:
- the current builder
- Throws:
IllegalStateException
- if the repositoryId has already been set to a different value
-
filterText
Limits the search to pull requests where the title or description contains thevalue
.- Parameters:
value
- the filter string- Returns:
- the current builder
- Since:
- 7.2
-
fromRepositoryId
Limits the pull requests to search for by the repository the changes are coming from.- Parameters:
value
- the repository ID to look for- Returns:
- the current builder
-
fromRefId
Limits the pull requests to search for by the branch the changes are coming from.- Parameters:
value
- the branch id- Returns:
- the current builder
-
fromRefIds
Limits the pull requests to search for by the branches the changes are coming from.- Parameters:
values
- the branch ids- Returns:
- the current builder
-
order
- Parameters:
value
- an order to order by- Returns:
- the current builder
-
orders
@Nonnull public PullRequestSearchRequest.Builder orders(@Nullable PullRequestOrder value, @Nullable PullRequestOrder... values) Specifies a list oforder
's to return the search results in (defaults toNEWEST first
).- Parameters:
value
- an order to order byvalues
- the orders to order by- Returns:
- the current builder
- Since:
- 8.17
-
orders
@Nonnull public PullRequestSearchRequest.Builder orders(@Nullable Iterable<PullRequestOrder> values) Specifies a list oforder
's to return the search results in (defaults toNEWEST first
).- Parameters:
values
- the orders to order by- Returns:
- the current builder
- Since:
- 8.17
-
participant
@Nonnull public PullRequestSearchRequest.Builder participant(@Nullable PullRequestParticipantRequest value) Limits the pull requests to search for by the participants they have.- Parameters:
value
- the participant- Returns:
- the current builder
-
participants
@Nonnull public PullRequestSearchRequest.Builder participants(@Nullable Iterable<PullRequestParticipantRequest> values) Limits the pull requests to search for by the participants they have.- Parameters:
values
- the participants- Returns:
- the current builder
-
state
Restricts the search to a specifiedpull request state
.- Parameters:
value
- the state to restrict to- Returns:
- the current builder
-
toRepositoryId
Limits the pull requests to search for by the repository the changes are going to.- Parameters:
value
- the repository ID to restrict the search by- Returns:
- the current builder
-
toRefId
Limits the pull requests to search for by the branches the changes are going to.- Parameters:
value
- the branch id- Returns:
- the current builder
-
toRefIds
Limits the pull requests to search for by the branches the changes are going to.- Parameters:
values
- the branch ids- Returns:
- the current builder
-
updatedSince
When set, limits the pull requests to search for pull requests where the updated timestamp is more recent than the specified date.- Parameters:
value
- the updated since date- Returns:
- the current builder
- Since:
- 7.12
-
withDescription
- Parameters:
value
- whether to fetch the description for matching pull requests- Returns:
- the current builder
-
withProperties
- Parameters:
value
- whether to fetch theproperties
for matching pull requests- Returns:
- the current builder
-