Class SimplePullRequestMergeHookRequest
java.lang.Object
com.atlassian.bitbucket.hook.repository.AbstractRepositoryHookRequest
com.atlassian.bitbucket.hook.repository.SimplePullRequestMergeHookRequest
- All Implemented Interfaces:
MergeHookRequest
,PullRequestMergeHookRequest
,RepositoryHookRequest
public class SimplePullRequestMergeHookRequest
extends AbstractRepositoryHookRequest
implements PullRequestMergeHookRequest
Basic implementation of
PullRequestMergeHookRequest
- Since:
- 5.0
-
Nested Class Summary
Nested classes/interfaces inherited from class com.atlassian.bitbucket.hook.repository.AbstractRepositoryHookRequest
AbstractRepositoryHookRequest.AbstractBuilder<B extends AbstractRepositoryHookRequest.AbstractBuilder<B>>
-
Method Summary
Methods inherited from class com.atlassian.bitbucket.hook.repository.AbstractRepositoryHookRequest
getContext, getRepository, getScmHookDetails, getTrigger, isDryRun
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.atlassian.bitbucket.hook.repository.RepositoryHookRequest
getContext, getRepository, getScmHookDetails, getTrigger, isDryRun
-
Method Details
-
getFromRef
- Specified by:
getFromRef
in interfaceMergeHookRequest
- Specified by:
getFromRef
in interfacePullRequestMergeHookRequest
- Returns:
- the pull request's
from-ref
-
getMergeHash
- Specified by:
getMergeHash
in interfaceMergeHookRequest
- Returns:
- the merge commit hash. Can be
Optional.empty()
if this is adry-run
request.
-
getMessage
- Specified by:
getMessage
in interfaceMergeHookRequest
- Returns:
- the commit message. Can be
Optional.empty()
if this is adry-run
request.
-
getPullRequest
- Specified by:
getPullRequest
in interfacePullRequestMergeHookRequest
- Returns:
- the pull request being merged
-
getStrategyId
- Specified by:
getStrategyId
in interfaceMergeHookRequest
- Returns:
- the merge strategy ID
- Since:
- 5.5
-
getToRef
- Specified by:
getToRef
in interfaceMergeHookRequest
- Specified by:
getToRef
in interfacePullRequestMergeHookRequest
- Returns:
- the pull request's
to-ref
-
getRefChanges
- Specified by:
getRefChanges
in interfaceRepositoryHookRequest
- Overrides:
getRefChanges
in classAbstractRepositoryHookRequest
- Returns:
- the proposed ref changes. Can be
empty
for some dry-run requests where the target hash is not yet known because the relevant commit hasn't been created yet. As an example, this is the case formerge requests
. In these cases, the specialized request type should provide sufficient information about the proposed change. ForMergeHookRequest
, this would beMergeHookRequest.getFromRef()
andMergeHookRequest.getToRef()
.
-
isCrossRepository
public boolean isCrossRepository()- Specified by:
isCrossRepository
in interfaceMergeHookRequest
- Returns:
true
if thefrom-ref
and theto-ref
are in different repositories, otherwisefalse
-