@TransactionAware public abstract class

PullRequestCancelableCommentEvent

extends PullRequestEvent
implements CancelableEvent
java.lang.Object
   ↳ java.util.EventObject
     ↳ com.atlassian.bitbucket.event.ApplicationEvent
       ↳ com.atlassian.bitbucket.event.pull.PullRequestEvent
         ↳ com.atlassian.bitbucket.event.pull.PullRequestCancelableCommentEvent
Known Direct Subclasses

Class Overview

Subclasses of this event are synchronous and allow callers to cancel the action and/or participate in the transaction (by persisting related entities, for example).

Summary

[Expand]
Inherited Fields
From class java.util.EventObject
Protected Constructors
PullRequestCancelableCommentEvent(Object source, PullRequest pullRequest, Comment comment, Comment parent, CommentAction commentAction, CancelState cancelState)
Public Methods
void cancel(KeyedMessage message)
Cancels the operation, providing a message explaining why.
@Nonnull Comment getComment()
@Nonnull CommentAction getCommentAction()
@Nullable Comment getParent()
boolean isCanceled()
Retrieves a flag indicating whether the operation has been canceled.
[Expand]
Inherited Methods
From class com.atlassian.bitbucket.event.pull.PullRequestEvent
From class com.atlassian.bitbucket.event.ApplicationEvent
From class java.util.EventObject
From class java.lang.Object
From interface com.atlassian.bitbucket.util.CancelState

Protected Constructors

protected PullRequestCancelableCommentEvent (Object source, PullRequest pullRequest, Comment comment, Comment parent, CommentAction commentAction, CancelState cancelState)

Public Methods

public void cancel (KeyedMessage message)

Cancels the operation, providing a message explaining why.

The cancellation message is required, and should be as descriptive and clear as possible to allow end users to correct, if possible, the issue that triggered cancellation.

Parameters
message a descriptive message explaining why the operation has been canceled

@Nonnull public Comment getComment ()

@Nonnull public CommentAction getCommentAction ()

@Nullable public Comment getParent ()

public boolean isCanceled ()

Retrieves a flag indicating whether the operation has been canceled.

In situations where multiple observers have the option to cancel an operation, for example when multiple listeners receive the same CancelableEvent, this flag can be useful for determining that another observer has already canceled the operation.

Returns
  • true if the operation has been canceled; otherwise, false