Skip to content

BeanDiff is a simple library to compare two objects using reflection.

License

Notifications You must be signed in to change notification settings

72services/beandiff

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

BeanDiff

BeanDiff is a simple library to compare two objects using reflection.

The objects don't need to have the same type. BeanDiff looks for matching field names and compares the values.

##Usage

  A a = new A();
  a.setName("Hello");

  B b = new B();
  b.setName("World");

  BeanDiff diff = new BeanDiff();
  diff.diff(a, b);

  assertTrue(diff.hasDifferences());

The BeanDiff object contains a map of type Difference and Difference contains the path to the property and the compared values.

###Example ouput of a Difference

Difference{path=/name, left=Hello, right=World}

BeanDiff is also using reflection for the string representation of the diff values.

##License BeanDiff is Open Source under Apache License Version 2 http://www.apache.org/licenses/LICENSE-2.0

About

BeanDiff is a simple library to compare two objects using reflection.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages