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
Fields -
Method Summary
Modifier and TypeMethodDescriptionFile type this anchor is anchored to in a diff.intgetLine()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 toby this anchor originated, orOptional.empty()if the change was notone that produces a new path.booleanbooleanbooleanbooleanAn 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.REMOVEDthis will always beDiffFileType.FROM - for
DiffSegmentType.ADDEDthis will always beDiffFileType.TO - for
DiffSegmentType.CONTEXTthe 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
presentif 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
presentif 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-removedline.- Returns:
- the range of line numbers the comment spans on the right-hand side, or
emptyif 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-addedline.- Returns:
- the range of line numbers the comment spans on the left-hand side, or
emptyif 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
presentif 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
presentif 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 toby 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.trueimplies 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.trueimplies 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.trueimplies thatisLineAnchor()returnstrueandisFileAnchor()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,falseotherwise
-