public interface

PullRequestMergeStrategy

com.atlassian.bitbucket.pull.PullRequestMergeStrategy

Class Overview

Describes a strategy for merging a pull request. Some strategies may only merge changes, producing one or more new commits, while others might merge commits, applying the pull request's commits to its target. Each strategy includes a brief description to help explain its approach to performing merges.

Summary

Public Methods
@Nonnull String getDescription()
Retrieves a short, descriptive summary of how the strategy performs merges, which can be used to help choose between available strategies.
@Nonnull Optional<String> getFlag()
Retrieves a well-known flag, or combination of flags, associated with the strategy, which may be helpful in associating the strategy with the behavior of a command line client.
@Nonnull String getId()
Retrieves the strategy's unique identifier, which is used to request the strategy when merging a pull request.
@Nonnull String getName()
Retrieves the strategy's name.
boolean isEnabled()
Retrieves a flag indicating whether or not the strategy is enabled.

Public Methods

@Nonnull public String getDescription ()

Retrieves a short, descriptive summary of how the strategy performs merges, which can be used to help choose between available strategies.

Returns
  • a short, descriptive summary the strategy

@Nonnull public Optional<String> getFlag ()

Retrieves a well-known flag, or combination of flags, associated with the strategy, which may be helpful in associating the strategy with the behavior of a command line client. Some strategies, which are built by extending or overriding standard SCM functionality, may not have flags associated with them.

Returns
  • a well-known flag, or combination of flags, associated with the strategy, which may be Optional.empty() if such flags don't exist, but never null

@Nonnull public String getId ()

Retrieves the strategy's unique identifier, which is used to request the strategy when merging a pull request.

Returns
  • a unique identifier for the strategy, used to request the strategy when merging

@Nonnull public String getName ()

Retrieves the strategy's name.

Returns
  • the strategy's name

public boolean isEnabled ()

Retrieves a flag indicating whether or not the strategy is enabled. Only enabled strategies may be requested when merging pull requests. Each repository is guaranteed to have at least one enabled strategy.

Administrators can configure the set of strategies they want to be available for pull requests in their repositories and may choose to enable a single strategy, to ensure all pull requests are merged the same way, or multiple strategies, to allow the most appropriate strategy to be selected at merge time based on the particulars of the pull request being merged.

Returns
  • true if this strategy is enabled and may be requested when merging a pull request; otherwise, false if an administrator has disabled this strategy