public class

PullRequestOutOfDateException

extends EntityOutOfDateException
java.lang.Object
   ↳ java.lang.Throwable
     ↳ java.lang.Exception
       ↳ java.lang.RuntimeException
         ↳ com.atlassian.bitbucket.ServiceException
           ↳ com.atlassian.bitbucket.EntityOutOfDateException
             ↳ com.atlassian.bitbucket.pull.PullRequestOutOfDateException

Class Overview

A specialization of EntityOutOfDateException thrown when a PullRequest's version is out-of-date.

Summary

[Expand]
Inherited Constants
From class com.atlassian.bitbucket.EntityOutOfDateException
Public Constructors
PullRequestOutOfDateException(KeyedMessage message, Throwable cause)
Constructs a PullRequestOutOfDateException with unspecified versions.
PullRequestOutOfDateException(KeyedMessage message, PullRequest pullRequest, int expectedVersion)
Constructs a PullRequestOutOfDateException, providing the current PullRequest and the version that was expected.
PullRequestOutOfDateException(KeyedMessage message, Throwable cause, PullRequest pullRequest, int expectedVersion)
Constructs a PullRequestOutOfDateException, providing the current PullRequest and the version that was expected.
Public Methods
@Nullable PullRequest getPullRequest()
Retrieves the current state for the pull request, if it was available when the exception was thrown.
[Expand]
Inherited Methods
From class com.atlassian.bitbucket.EntityOutOfDateException
From class com.atlassian.bitbucket.ServiceException
From class java.lang.Throwable
From class java.lang.Object

Public Constructors

public PullRequestOutOfDateException (KeyedMessage message, Throwable cause)

Constructs a PullRequestOutOfDateException with unspecified versions. Because this constructor provides so little information, it should be avoided except in situaitons where there is simply no additional information available.

Parameters
message a message describing the error
cause the triggering exception, or null if no cause is available

public PullRequestOutOfDateException (KeyedMessage message, PullRequest pullRequest, int expectedVersion)

Constructs a PullRequestOutOfDateException, providing the current PullRequest and the version that was expected.

Parameters
message a message describing the error
pullRequest the current pull request state
expectedVersion the expected pull request version, generally older (lower) than the current version

public PullRequestOutOfDateException (KeyedMessage message, Throwable cause, PullRequest pullRequest, int expectedVersion)

Constructs a PullRequestOutOfDateException, providing the current PullRequest and the version that was expected.

Parameters
message a message describing the error
cause the triggering exception, or null if no cause is available
pullRequest the current pull request state
expectedVersion the expected pull request version, generally older (lower) than the current version

Public Methods

@Nullable public PullRequest getPullRequest ()

Retrieves the current state for the pull request, if it was available when the exception was thrown. When available, the version of the returned pull request will always match the current version.

Returns
  • the current pull request, or null if the current state was not available