Interface CommentThreadDiffAnchor


public interface CommentThreadDiffAnchor
The location in a diff a comment thread is anchored to.
Since:
5.0
  • Field Details

  • Method Details

    • getDiffType

      @Nonnull CommentThreadDiffAnchorType getDiffType()
      Returns:
      the diff type associated with this anchor
    • getFileType

      @Nonnull Optional<DiffFileType> getFileType()
      File type this anchor is anchored to in a diff.

      The following relationship with getLineType() occurs:

      Returns:
      type of the file this anchor is anchored to in a diff. It will only be present if this is a line anchor
      See Also:
    • getFromHash

      @Nonnull Optional<String> getFromHash()
    • getLine

      int getLine()
    • getLineType

      @Nonnull Optional<DiffSegmentType> getLineType()
      Returns:
      type of the line this anchor is anchored to. It will only be present if this is a line anchor
      See Also:
    • getMultilineDestinationRange

      @Nonnull Optional<LineNumberRange> getMultilineDestinationRange()
      The destination range represents all lines a multi-line comment spans on the right-hand side of a diff. This is only present if this is a multiline anchor, and within it's span exists at least one non-removed line.
      Returns:
      the range of line numbers the comment spans on the right-hand side, or empty if the comment is not a multiline comment or contains only removed lines
      Since:
      9.3
    • getMultilineSourceRange

      @Nonnull Optional<LineNumberRange> getMultilineSourceRange()
      The source range represents all lines a multi-line comment spans on the left-hand side of a diff. This is only present if this is a multiline anchor, and within it's span exists at least one non-added line.
      Returns:
      the range of line numbers the comment spans on the left-hand side, or empty if the comment is not a multiline comment or contains only added lines
      Since:
      9.3
    • getMultilineStartLine

      @Nonnull Optional<Integer> getMultilineStartLine()
      Returns:
      the line number the first line of a multiline comment. It will only be present if this is a multiline anchor
      Since:
      9.2
    • getMultilineStartLineType

      @Nonnull Optional<DiffSegmentType> getMultilineStartLineType()
      Returns:
      type of the line the first line of a multiline comment is attached to. It will only be present if this is a multiline anchor
      Since:
      9.2
      See Also:
    • getPath

      @Nonnull String getPath()
      Returns:
      the path to the contents this anchor points to
    • getSrcPath

      @Nonnull Optional<String> getSrcPath()
      The original path at which the content pointed to by this anchor originated, or Optional.empty() if the change was not one that produces a new path.
      Returns:
      the original path of the contents referred to by this anchor
    • getToHash

      @Nonnull String getToHash()
    • isFileAnchor

      boolean isFileAnchor()
      Returns:
      true, if this is a file comment anchor, i.e. an anchor associated with the whole file rather than a particular line. true implies that isLineAnchor() returns false.
      See Also:
    • isLineAnchor

      boolean isLineAnchor()
      Returns:
      true, if this is a line comment anchor, i.e. an anchor associated with a particular line in the file. true implies that isFileAnchor() returns false.
      See Also:
    • isMultilineAnchor

      boolean isMultilineAnchor()
      Returns:
      true, if this is a multiline comment anchor, i.e. an anchor associated with a range of lines in the file. true implies that isLineAnchor() returns true and isFileAnchor() returns false.
      Since:
      9.2
      See Also:
    • isOrphaned

      boolean isOrphaned()
      An orphaned anchor point is out-of-date in the current state of a diff. E.g. the anchor points to a path that is no longer in scope of the pull request, because the changes to that file have been reverted on the source branch.
      Returns:
      true, if the anchor is orphaned, false otherwise