public interface

DiffCommentAnchor

com.atlassian.stash.comment.DiffCommentAnchor
Known Indirect Subclasses

Summary

Constants
int NO_LINE
Fields
public static final Predicate<? super DiffCommentAnchor> IS_FILE_COMMENT A predicate for finding file comment anchors.
public static final Predicate<? super DiffCommentAnchor> IS_LINE_COMMENT A predicate for finding isLineComment() line comment anchors}.
Public Methods
@Nonnull Comment getComment()
@Nullable DiffFileType getFileType()
File type this anchor is anchored to in a Stash diff.
@Nullable String getFromHash()
int getLine()
@Nullable DiffSegmentType getLineType()
@Nonnull String getPath()
@Nullable String getSrcPath()
The original path at which the content pointed to by this anchor originated, or null, if the change was not one that produces a new path.
@Nonnull String getToHash()
boolean isFileComment()
boolean isLineComment()

Constants

public static final int NO_LINE

Constant Value: 0 (0x00000000)

Fields

public static final Predicate<? super DiffCommentAnchor> IS_FILE_COMMENT

A predicate for finding file comment anchors.

public static final Predicate<? super DiffCommentAnchor> IS_LINE_COMMENT

A predicate for finding isLineComment() line comment anchors}.

Public Methods

@Nonnull public Comment getComment ()

Returns
  • the comment associated with this anchor

@Nullable public DiffFileType getFileType ()

File type this anchor is anchored to in a Stash diff.

The following relationship with getLineType() occurs:

  • for REMOVED this will always be FROM
  • for ADDED this will always be TO
  • for 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, null if this is not a line anchor
See Also

@Nullable public String getFromHash ()

public int getLine ()

@Nullable public DiffSegmentType getLineType ()

Returns
  • type of the line this anchor is anchored to, null if this is not a line anchor
See Also

@Nonnull public String getPath ()

Returns
  • the path to the contents this anchor points to

@Nullable public String getSrcPath ()

The original path at which the content pointed to by this anchor originated, or null, if the change was not one that produces a new path.

Returns
  • the original path of the contents referred to by this anchor

@Nonnull public String getToHash ()

public boolean isFileComment ()

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 isLineComment() returns false.
See Also

public boolean isLineComment ()

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