Interface PullRequestParticipant

All Superinterfaces:
Comparable<PullRequestParticipant>

public interface PullRequestParticipant extends Comparable<PullRequestParticipant>
Describes a participant on a pull request.

Each participant has a role, such as author or reviewer.

See Also:
  • Method Details

    • getLastReviewedCommit

      @Nullable @OptionalString(minimumSize=40, size=40) String getLastReviewedCommit()
      The commit hash at which this participant last reviewed the pull request.

      A participant is considered to have reviewed a pull request when their status is changed to PullRequestParticipantStatus.NEEDS_WORK or PullRequestParticipantStatus.APPROVED. A pull request being rescoped does not trigger updating of participant's last reviewed commits so it is possible for the commit hash returned to no longer be part of the pull request.

      This method will return null if the participant has not yet reviewed the pull request. The last reviewed commit for a participant may also be reset back to null if changes to the pull request mean the commit hash may no longer be suitable for the application to use internally.

      Returns:
      the commit hash at which this participant last reviewed the pull request
      Since:
      4.9
    • getPullRequest

      @Nonnull PullRequest getPullRequest()
      Returns:
      the pull request this participant is associated with
    • getRole

      @Nonnull PullRequestRole getRole()
      Returns:
      the role of this participant in the pull request.
    • getStatus

      @Nonnull PullRequestParticipantStatus getStatus()
      Returns:
      the status of this participant in the pull request.
      Since:
      4.2
    • getUser

      @Nonnull ApplicationUser getUser()
      Returns:
      the user participating in the pull request
    • isApproved

      boolean isApproved()
      Returns:
      true if the status of this participant is APPROVED false otherwise
    • compareTo

      int compareTo(@Nonnull PullRequestParticipant other)
      Sorts participants first by status, then by name
      Specified by:
      compareTo in interface Comparable<PullRequestParticipant>
      Parameters:
      other - the participant to compare to
      Returns:
      1. 0 if other has same status and same name
      2. < 0 if other has approved the pull request and this has not, or if other has same status but comes first when alphabetically ordered by name
      3. > 0 otherwise
      Throws:
      NullPointerException - if other is null
      Since:
      4.2