Class PullRequestMergedEvent
java.lang.Object
java.util.EventObject
com.atlassian.bitbucket.event.ApplicationEvent
com.atlassian.bitbucket.event.pull.PullRequestEvent
com.atlassian.bitbucket.event.pull.PullRequestMergedEvent
- All Implemented Interfaces:
- RepositoryRefsChangedEvent,- Serializable
@AsynchronousPreferred
public class PullRequestMergedEvent
extends PullRequestEvent
implements RepositoryRefsChangedEvent
Event raised when a pull request is merged via the web UI or REST, or when a remote merge is detected.
 
 If the pull request was merged by the system, the commit resulting from the merge (which
 may or may not be a literal merge commit, depending on the configured merge strategy) will be included. Otherwise,
 if the pull request was merged remotely, meaning a commit which is a descendant of the
 from ref was pushed to the to ref, the commit
 will not be provided.
 
 Listeners that are interested in all repository changes (and not just pull request merges) should listen for
 RepositoryRefsChangedEvents.
- See Also:
- 
Field SummaryFields inherited from class java.util.EventObjectsource
- 
Constructor SummaryConstructorsConstructorDescriptionPullRequestMergedEvent(Object source, PullRequest pullRequest) Constructs a newPullRequestMergedEvent.PullRequestMergedEvent(Object source, PullRequest pullRequest, MinimalCommit commit, String message) Constructs a newPullRequestMergedEvent.PullRequestMergedEvent(Object source, PullRequest pullRequest, MinimalCommit commit, String message, String strategyId, boolean autoMerge) Constructs a newPullRequestMergedEvent.
- 
Method SummaryModifier and TypeMethodDescriptionRetrieves a collection of thechanged refs.Retrieves the repository in which refs were changed.booleanbooleanMethods inherited from class com.atlassian.bitbucket.event.pull.PullRequestEventgetAction, getPullRequestMethods inherited from class com.atlassian.bitbucket.event.ApplicationEventgetDate, getUserMethods inherited from class java.util.EventObjectgetSource, toStringMethods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface com.atlassian.bitbucket.event.repository.RepositoryRefsChangedEventgetUser
- 
Constructor Details- 
PullRequestMergedEventConstructs a newPullRequestMergedEvent. This is a convenience constructor for remotely-merged pull requests, where themerge commitis not known.- Parameters:
- source- the entity raising the event
- pullRequest- the pull request that was merged
 
- 
PullRequestMergedEventpublic PullRequestMergedEvent(@Nonnull Object source, @Nonnull PullRequest pullRequest, @Nullable MinimalCommit commit, @Nullable String message) Constructs a newPullRequestMergedEvent. Themerge commitshould be provided if the pull request was merged by the system, and should be leftnullif the merge was pushed by a user.- Parameters:
- source- the entity raising the event
- pullRequest- the pull request that was merged
- commit- the commit that resulted from the merging the pull request via the web UI or REST, which may by- nullif the pull request was merged remotely and pushed up
- message- the commit message, which may be- null
- Since:
- 8.14
 
- 
PullRequestMergedEventpublic PullRequestMergedEvent(@Nonnull Object source, @Nonnull PullRequest pullRequest, @Nullable MinimalCommit commit, @Nullable String message, @Nullable String strategyId, boolean autoMerge) Constructs a newPullRequestMergedEvent. Themerge commitshould be provided if the pull request was merged by the system, and should be leftnullif the merge was pushed by a user.- Parameters:
- source- the entity raising the event
- pullRequest- the pull request that was merged
- commit- the commit that resulted from the merging the pull request via the web UI or REST, which may by- nullif the pull request was merged remotely and pushed up
- message- the commit message, which may be- null
- strategyId- the strategy used to merge the pull request
- autoMerge-- trueif the pull request was- auto-mergedby the system on behalf of a user; otherwise- false
- Since:
- 8.14
 
 
- 
- 
Method Details- 
getCommit- Returns:
- the merge commit, which may be nullif the pull request was merged remotely
 
- 
getMessage- Returns:
- the proposed commit message, which may be null
 
- 
getRefChangesDescription copied from interface:RepositoryRefsChangedEventRetrieves a collection of thechanged refs.Note: While the returned collection will never be null, it may be empty. For example, aremotely merged pull requestwill have an empty set of changes.- Specified by:
- getRefChangesin interface- RepositoryRefsChangedEvent
- Returns:
- a collection of updated refswhich may be empty, if the pull request was merged remotely, or contain a single updated ref for the pull request'starget branch, if the pull request was merged via the web UI or REST
 
- 
getRepositoryDescription copied from interface:RepositoryRefsChangedEventRetrieves the repository in which refs were changed. All of thechanged refsfor a single event will always be in the same repository.- Specified by:
- getRepositoryin interface- RepositoryRefsChangedEvent
- Returns:
- the repository into which the pull request was merged
 
- 
getStrategyId- Returns:
- the ID of the strategy used to merge the pull request
- Since:
- 4.9
 
- 
isAutoMergepublic boolean isAutoMerge()- Returns:
- trueif the pull request was- auto-mergedby the system on behalf of a user; otherwise- false
- Since:
- 8.14
- See Also:
 
- 
isMergedRemotelypublic boolean isMergedRemotely()- Returns:
- trueif the pull request was merged remotely and pushed up; otherwise,- falseif the pull request was merged via the web UI or REST
 
 
-