Interface IDiffManager
public interface IDiffManager
Entry point for higher-level object diffing and history analysis.
Usage of ignoredFields is recommended as creating of history for all fields can be slow in some cases.
Recommended list of ignored fields for Work Items are defined in constant IWorkItem.DIFF_IGNORED_FIELDS.
- Author:
- POLARION SOFTWARE
-
Method Summary
Modifier and TypeMethodDescriptiongenerateChange
(String user, Date timeStamp, String revison, IPObject beforeObject, IPObject afterObject, Set<String> ignoredFields) Shortcut forgenerateChange(user, timeStamp, revision, beforeObject, afterObject, ignoredFields, new String[0])
generateChange
(String user, Date timeStamp, String revison, IPObject beforeObject, IPObject afterObject, Set<String> ignoredFields, String[] fieldOrder) Compares the given objects and creates theIChange
, filling its fields withuser, timeStamp, revision
values.generateDiff
(IPObject beforeObject, IPObject afterObject, Set<String> ignoredFields) Shortcut forgenerateDiff(beforeObject, afterObject, ignoredFields, new String[0]
generateDiff
(IPObject beforeObject, IPObject afterObject, Set<String> ignoredFields, String[] fieldOrder) Compares two objects and produces diff for individual fields.IChange[]
generateHistory
(IPObject object, Set<String> ignoredFields) Shortcut forgenerateHistory(object, ignoredFields, new String[0], false)
.IChange[]
generateHistory
(IPObject object, Set<String> ignoredFields, String[] fieldOrder) Shortcut forgenerateHistory(object, ignoredFields, fieldOrder, false)
.IChange[]
generateHistory
(IPObject object, Set<String> ignoredFields, String[] fieldOrder, boolean includeEmpty) Retrieves the complete history of given object and transforms it into series of change objects.getDiffGenerator
(String key, IPrototype prototype)
-
Method Details
-
generateDiff
@NotNull IFieldDiff[] generateDiff(@NotNull IPObject beforeObject, @NotNull IPObject afterObject, @NotNull Set<String> ignoredFields, @Nullable String[] fieldOrder) Compares two objects and produces diff for individual fields. Only changed fields are present in the resulting array. Ignored fields are considered unchanged.The resulting diff array will start with fields defined in
fieldOrder
parameter, followed by other fields in lexicographical order.- Parameters:
ignoredFields
- Set ofString
field names to ignore- Returns:
- an array containing
IFieldDiff
for each differing field of the objects
-
generateDiff
@NotNull IFieldDiff[] generateDiff(@NotNull IPObject beforeObject, @NotNull IPObject afterObject, @NotNull Set<String> ignoredFields) Shortcut forgenerateDiff(beforeObject, afterObject, ignoredFields, new String[0]
-
generateChange
@NotNull IChange generateChange(String user, Date timeStamp, String revison, @NotNull IPObject beforeObject, @NotNull IPObject afterObject, @NotNull Set<String> ignoredFields, @Nullable String[] fieldOrder) Compares the given objects and creates theIChange
, filling its fields withuser, timeStamp, revision
values.The diff array inside the change will start with fields defined in
fieldOrder
parameter, followed by other fields in lexicographical order.- Parameters:
ignoredFields
- SeegenerateDiff(IPObject, IPObject, Set, String[])
fieldOrder
- SeegenerateDiff(IPObject, IPObject, Set, String[])
- Returns:
- a populated
IChange
instance
-
generateChange
@NotNull IChange generateChange(String user, Date timeStamp, String revison, @NotNull IPObject beforeObject, @NotNull IPObject afterObject, @NotNull Set<String> ignoredFields) Shortcut forgenerateChange(user, timeStamp, revision, beforeObject, afterObject, ignoredFields, new String[0])
- Returns:
- a populated
IChange
instance - See Also:
-
generateHistory
@NotNull IChange[] generateHistory(@NotNull IPObject object, @NotNull Set<String> ignoredFields, @Nullable String[] fieldOrder, boolean includeEmpty) Retrieves the complete history of given object and transforms it into series of change objects.- Parameters:
ignoredFields
- SeegenerateDiff(IPObject, IPObject, Set, String[])
fieldOrder
- SeegenerateDiff(IPObject, IPObject, Set, String[])
includeEmpty
- whether changes without any detected field diffs should be included- Returns:
- an array of populated
IChange
instances for all revisions of the object - Since:
- 3.10.0
-
generateHistory
@NotNull IChange[] generateHistory(@NotNull IPObject object, @NotNull Set<String> ignoredFields, @Nullable String[] fieldOrder) Shortcut forgenerateHistory(object, ignoredFields, fieldOrder, false)
. -
generateHistory
Shortcut forgenerateHistory(object, ignoredFields, new String[0], false)
. -
getDiffGenerator
- Since:
- 3.5.0
-