Package com.atlassian.bitbucket.comment
Interface CommentThreadDiffAnchor
public interface CommentThreadDiffAnchor
The location in a diff a
comment thread
is anchored to.- Since:
- 5.0
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionFile type this anchor is anchored to in a diff.int
getLine()
The destination range represents all lines a multi-line comment spans on the right-hand side of a diff.The source range represents all lines a multi-line comment spans on the left-hand side of a diff.getPath()
The original path at which thecontent pointed to
by this anchor originated, orOptional.empty()
if the change was notone that produces a new path
.boolean
boolean
boolean
boolean
An orphaned anchor point is out-of-date in the current state of a diff.
-
Field Details
-
NO_LINE
static final int NO_LINE- See Also:
-
-
Method Details
-
getDiffType
- Returns:
- the diff type associated with this anchor
-
getFileType
File type this anchor is anchored to in a diff.The following relationship with
getLineType()
occurs:- for
DiffSegmentType.REMOVED
this will always beDiffFileType.FROM
- for
DiffSegmentType.ADDED
this will always beDiffFileType.TO
- for
DiffSegmentType.CONTEXT
the anchor can be hooked to any of the diff files
- Returns:
- type of the file this anchor is anchored to in a diff. It will only be
present
if this is aline anchor
- See Also:
- for
-
getFromHash
-
getLine
int getLine() -
getLineType
- Returns:
- type of the line this anchor is anchored to. It will only be
present
if this is aline anchor
- See Also:
-
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 amultiline anchor
, and within it's span exists at least onenon-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
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 amultiline anchor
, and within it's span exists at least onenon-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
- Returns:
- the line number the first line of a multiline comment. It will only be
present
if this is amultiline anchor
- Since:
- 9.2
-
getMultilineStartLineType
- Returns:
- type of the line the first line of a multiline comment is attached to. It will only be
present
if this is amultiline anchor
- Since:
- 9.2
- See Also:
-
getPath
- Returns:
- the path to the contents this anchor points to
-
getSrcPath
The original path at which thecontent pointed to
by this anchor originated, orOptional.empty()
if the change was notone that produces a new path
.- Returns:
- the original path of the contents referred to by this anchor
-
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 thatisLineAnchor()
returnsfalse
.- 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 thatisFileAnchor()
returnsfalse
.- 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 thatisLineAnchor()
returnstrue
andisFileAnchor()
returnsfalse
.- 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
-