Skip to content

JDiffPatch compares two objects and creates a DiffRecord which contains the old and new value

Notifications You must be signed in to change notification settings

empinator/JDiffPatch

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 

Repository files navigation

Description

JDiffPatch compares two objects and creates a DiffRecord which contains the old and new value

This DiffRecord can be used to patch any object of the same kind

Usage


JDiff diffCreator = new JDiff();

DiffRecord diffRecord = diffCreator.compare(newObject, oldObject);

assert oldObject.getText() != newObject.getText();

JPatch patcher = new JPatch(oldObject);
patcher.patch(diffRecord);

assert oldObject.getText() == newObject.getText();

About

JDiffPatch compares two objects and creates a DiffRecord which contains the old and new value

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages