Class PullRequestSearchRequest.Builder

java.lang.Object
com.atlassian.bitbucket.util.BuilderSupport
com.atlassian.bitbucket.pull.PullRequestSearchRequest.Builder
Enclosing class:
PullRequestSearchRequest

public static class PullRequestSearchRequest.Builder extends BuilderSupport
  • Constructor Details

    • Builder

      public Builder()
  • Method Details

    • build

      @Nonnull public PullRequestSearchRequest build()
      Assembles a new PullRequestSearchRequest from the provided values.
      Returns:
      a new pull request search request instance
    • closedSince

      @Nonnull public PullRequestSearchRequest.Builder closedSince(@Nullable Date value)
      When set, limits the pull requests to search for pull requests in the closed state (i.e. PullRequestState.MERGED or PullRequestState.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

      @Nonnull public PullRequestSearchRequest.Builder draft(@Nullable Boolean value)
      Limits the search to pull requests that match the specified draft status.
      Parameters:
      value - If true, then only draft pull requests will be returned. If false, then only non-draft pull requests will be returned. If null, 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 direction
      repositoryId - the repository to restrict by
      branch - the branch to restrict by
      Returns:
      the current builder
      Throws:
      IllegalStateException - if the repositoryId has already been set to a different value
    • filterText

      @Nonnull public PullRequestSearchRequest.Builder filterText(@Nullable String value)
      Limits the search to pull requests where the title or description contains the value.
      Parameters:
      value - the filter string
      Returns:
      the current builder
      Since:
      7.2
    • fromRepositoryId

      @Nonnull public PullRequestSearchRequest.Builder fromRepositoryId(@Nullable Integer value)
      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

      @Nonnull public PullRequestSearchRequest.Builder fromRefId(@Nullable String value)
      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

      @Nonnull public PullRequestSearchRequest.Builder fromRefIds(@Nullable Iterable<String> values)
      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

      @Nonnull public PullRequestSearchRequest.Builder order(@Nullable PullRequestOrder value)
      Specifies a order to return the search results in (defaults to NEWEST).
      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 of order's to return the search results in (defaults to NEWEST first).
      Parameters:
      value - an order to order by
      values - 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 of order's to return the search results in (defaults to NEWEST 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

      @Nonnull public PullRequestSearchRequest.Builder state(@Nullable PullRequestState value)
      Restricts the search to a specified pull request state.
      Parameters:
      value - the state to restrict to
      Returns:
      the current builder
    • toRepositoryId

      @Nonnull public PullRequestSearchRequest.Builder toRepositoryId(@Nullable Integer value)
      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

      @Nonnull public PullRequestSearchRequest.Builder toRefId(@Nullable String value)
      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

      @Nonnull public PullRequestSearchRequest.Builder toRefIds(@Nullable Iterable<String> values)
      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

      @Nonnull public PullRequestSearchRequest.Builder updatedSince(@Nullable Date value)
      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

      @Nonnull public PullRequestSearchRequest.Builder withDescription(boolean value)
      Parameters:
      value - whether to fetch the description for matching pull requests
      Returns:
      the current builder
    • withProperties

      @Nonnull public PullRequestSearchRequest.Builder withProperties(boolean value)
      Parameters:
      value - whether to fetch the properties for matching pull requests
      Returns:
      the current builder