A file comparison that contains information on the changes to a file.
There are two subtypes: FileComparisonNotRenamed
and FileComparisonRenamed
that have different guarantees.
FileComparisonNotRenamed
guarantees that thepatch
field exists, does not have aprevious_filename
field.FileComparisonRenamed
guarantees that theprevious_filename
field exists and sometimes contains apatch
field.
To get values from these fields, there are helper methods getPatch
and getPreviousFilename
, though
it is recomended to match on your FileComparison
value to determine which type it is, to remove ambiguity.
- Companion:
- object
Value members
Abstract methods
Gets the contents of the patch
field if it exists, in the case that the file was modified.
To guarantee that the patch
field is available, match this FileComparison
value as a
FileComparison.FileComparisonNotRenamed
type which always has this field.
Gets the contents of the patch
field if it exists, in the case that the file was modified.
To guarantee that the patch
field is available, match this FileComparison
value as a
FileComparison.FileComparisonNotRenamed
type which always has this field.
Gets the contents of the previous_filename
field if it exists.
This field is guaranteed to appear in the event of any rename.
To guarantee that this field is available, match this FileComparison
value as a
FileComparison.FileComparisonRenamde
type which always has this field.
Gets the contents of the previous_filename
field if it exists.
This field is guaranteed to appear in the event of any rename.
To guarantee that this field is available, match this FileComparison
value as a
FileComparison.FileComparisonRenamde
type which always has this field.