public interface Diff extends PropertySupport
DiffContentCallback
Modifier and Type | Method and Description |
---|---|
Path |
getDestination()
Retrieves the path for the changed file.
|
List<DiffHunk> |
getHunks()
Retrieves a list containing zero or more
hunks describing the changed lines
within the file. |
Path |
getSource()
Retrieves the path for the file before it was changed.
|
boolean |
isBinary()
Retrieves a flag indicating whether the changed file is binary.
|
boolean |
isTruncated()
Retrieves a flag indicating whether the list of
hunks had to be truncated. |
getProperties
@Nullable Path getDestination()
This value has three categories:
source
, indicating the file was modified in-placegetSource()
source}, indicating the file was copied, moved or
renamed, potentially with or without content changesnull
, indicating the file was deleted
Note: While the destination and the source
may each be null
, they will
never both be null
.
@Nonnull List<DiffHunk> getHunks()
hunks
describing the changed lines
within the file. The list may be empty, but never null
.@Nullable Path getSource()
This value has three categories:
destination
, indicating the file was modified in-placedestination
, indicating the file was copied, moved or
renamed, potentially with or without content changesnull
, indicating the file is new
Note: While the destination
and the source may each be null
, they will never
both be null
.
boolean isBinary()
Note: When this flag is true
, the hunks
list will always be empty.
true
if the changed file is binary, indicating there is no diff; otherwise, false
boolean isTruncated()
hunks
had to be truncated.
To manage resource consumption, the system may impose a limit on the size of diffs it is willing to
render. This flag is set to inform callers when such limits are exceeded. Diffs may be truncated at
many different levels. Additional truncation flags exist for hunks
,
segments
and lines
, allowing callers
to know exactly how the diff was truncated.
Note: If this flag is true
but no hunks
are truncated
, it means at least one hunk was entirely omitted.
true
if the diff was truncated, removing one or moreCopyright © 2019 Atlassian. All rights reserved.