@AsynchronousPreferred public class PullRequestMergedEvent extends PullRequestEvent implements RepositoryRefsChangedEvent
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
RepositoryRefsChangedEvent
s.
source
Constructor and Description |
---|
PullRequestMergedEvent(Object source,
PullRequest pullRequest)
Constructs a new
PullRequestMergedEvent . |
PullRequestMergedEvent(Object source,
PullRequest pullRequest,
MinimalCommit commit,
String message,
Map<String,Object> context)
Constructs a new
PullRequestMergedEvent . |
PullRequestMergedEvent(Object source,
PullRequest pullRequest,
MinimalCommit commit,
String message,
String strategyId,
Map<String,Object> context)
Constructs a new
PullRequestMergedEvent . |
Modifier and Type | Method and Description |
---|---|
MinimalCommit |
getCommit() |
Map<String,Object> |
getContext() |
String |
getMessage() |
Collection<RefChange> |
getRefChanges()
Retrieves a collection of the
changed refs . |
Repository |
getRepository()
Retrieves the repository in which refs were changed.
|
String |
getStrategyId() |
boolean |
isMergedRemotely() |
getAction, getPullRequest
getDate, getUser
getSource, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getUser
public PullRequestMergedEvent(@Nonnull Object source, @Nonnull PullRequest pullRequest)
PullRequestMergedEvent
. This is a convenience constructor for remotely-merged pull
requests, where the merge commit
is not known.source
- the entity raising the eventpullRequest
- the pull request that was mergedpublic PullRequestMergedEvent(@Nonnull Object source, @Nonnull PullRequest pullRequest, @Nullable MinimalCommit commit, @Nullable String message, @Nonnull Map<String,Object> context)
PullRequestMergedEvent
. The merge commit
should be provided if
the pull request was merged by the system, and should be left null
if the merge was pushed by a user.source
- the entity raising the eventpullRequest
- the pull request that was mergedcommit
- the commit that resulted from the merging the pull request via the web UI or REST, which may
by null
if the pull request was merged remotely and pushed upmessage
- the commit message, which may be null
context
- additional context provided when merging the pull request, intended to allow plugins to
add their own functionality around the merge operationpublic PullRequestMergedEvent(@Nonnull Object source, @Nonnull PullRequest pullRequest, @Nullable MinimalCommit commit, @Nullable String message, @Nullable String strategyId, @Nonnull Map<String,Object> context)
PullRequestMergedEvent
. The merge commit
should be provided if
the pull request was merged by the system, and should be left null
if the merge was pushed by a user.source
- the entity raising the eventpullRequest
- the pull request that was mergedcommit
- the commit that resulted from the merging the pull request via the web UI or REST, which may
by null
if the pull request was merged remotely and pushed upmessage
- the commit message, which may be null
strategyId
- the strategy used to merge the pull requestcontext
- additional context provided when merging the pull request, intended to allow plugins to
add their own functionality around the merge operation@Nullable public MinimalCommit getCommit()
null
if the pull request was merged remotely@Nonnull public Map<String,Object> getContext()
@Nullable public String getMessage()
null
@Nonnull public Collection<RefChange> getRefChanges()
RepositoryRefsChangedEvent
changed refs
.
Note: While the returned collection will never be null
, it may be empty. For example, a
remotely merged pull request
will have an empty set of changes.
getRefChanges
in interface RepositoryRefsChangedEvent
updated refs
which may be empty, if the pull request was merged
remotely, or contain a single updated ref for the pull request's target
branch
, if the pull request was merged via the web UI or REST@Nonnull public Repository getRepository()
RepositoryRefsChangedEvent
changed refs
for a
single event will always be in the same repository.getRepository
in interface RepositoryRefsChangedEvent
@Nullable public String getStrategyId()
public boolean isMergedRemotely()
true
if the pull request was merged remotely and pushed up; otherwise, false
if the pull request was merged via the web UI or RESTCopyright © 2019 Atlassian. All rights reserved.