public static class

PullRequestSearchRequest.Builder

extends BuilderSupport
java.lang.Object
   ↳ com.atlassian.stash.util.BuilderSupport
     ↳ com.atlassian.stash.pull.PullRequestSearchRequest.Builder

Summary

[Expand]
Inherited Fields
From class com.atlassian.stash.util.BuilderSupport
Public Constructors
PullRequestSearchRequest.Builder()
Public Methods
@Nonnull PullRequestSearchRequest build()
Assembles a new PullRequestSearchRequest from the provided values.
@Nonnull PullRequestSearchRequest.Builder fromBranchId(String branchId)
Limits the pull requests to search for by the branch the changes are coming from.
@Nonnull PullRequestSearchRequest.Builder fromBranchIds(Iterable<String> branchIds)
Limits the pull requests to search for by the branches the changes are coming from.
@Nonnull PullRequestSearchRequest.Builder fromRepositoryId(Integer repositoryId)
Limits the pull requests to search for by the repository the changes are coming from.
@Nonnull PullRequestSearchRequest.Builder order(PullRequestOrder order)
The order to return the search results in (defaults to NEWEST first).
@Nonnull PullRequestSearchRequest.Builder 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.
@Nonnull PullRequestSearchRequest.Builder state(PullRequestState state)
Restricts the search to a specified pull request state.
@Nonnull PullRequestSearchRequest.Builder toBranchId(String branchId)
Limits the pull requests to search for by the branches the changes are going to.
@Nonnull PullRequestSearchRequest.Builder toBranchIds(Iterable<String> branchIds)
Limits the pull requests to search for by the branches the changes are going to.
@Nonnull PullRequestSearchRequest.Builder toRepositoryId(Integer repositoryId)
Limits the pull requests to search for by the repository the changes are going to.
[Expand]
Inherited Methods
From class com.atlassian.stash.util.BuilderSupport
From class java.lang.Object

Public Constructors

public PullRequestSearchRequest.Builder ()

Public Methods

@Nonnull public PullRequestSearchRequest build ()

Assembles a new PullRequestSearchRequest from the provided values.

Returns
  • a new pull request search request instance

@Nonnull public PullRequestSearchRequest.Builder fromBranchId (String branchId)

Limits the pull requests to search for by the branch the changes are coming from.

Parameters
branchId the branch id
Returns
  • the current builder

@Nonnull public PullRequestSearchRequest.Builder fromBranchIds (Iterable<String> branchIds)

Limits the pull requests to search for by the branches the changes are coming from.

Parameters
branchIds the branch ids
Returns
  • the current builder

@Nonnull public PullRequestSearchRequest.Builder fromRepositoryId (Integer repositoryId)

Limits the pull requests to search for by the repository the changes are coming from.

Parameters
repositoryId the repository id to look for
Returns
  • the current builder

@Nonnull public PullRequestSearchRequest.Builder order (PullRequestOrder order)

The order to return the search results in (defaults to NEWEST first).

Parameters
order required order
Returns
  • the current builder

@Nonnull public PullRequestSearchRequest.Builder 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.

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

@Nonnull public PullRequestSearchRequest.Builder state (PullRequestState state)

Restricts the search to a specified pull request state.

Parameters
state the state to restrict to
Returns
  • the current builder

@Nonnull public PullRequestSearchRequest.Builder toBranchId (String branchId)

Limits the pull requests to search for by the branches the changes are going to.

Parameters
branchId the branch id
Returns
  • the current builder

@Nonnull public PullRequestSearchRequest.Builder toBranchIds (Iterable<String> branchIds)

Limits the pull requests to search for by the branches the changes are going to.

Parameters
branchIds the branch ids
Returns
  • the current builder

@Nonnull public PullRequestSearchRequest.Builder toRepositoryId (Integer repositoryId)

Limits the pull requests to search for by the repository the changes are going to.

Parameters
repositoryId the repository id to restrict the search by
Returns
  • the current builder