Is there a Java library that can “diff” two Objects?

前端 未结 7 1059
长发绾君心
长发绾君心 2020-11-28 03:35

Is there a Java utility library that is analogous to the Unix program diff, but for Objects? I\'m looking for something that can compare two objects of the same type and ge

7条回答
  •  夕颜
    夕颜 (楼主)
    2020-11-28 04:11

    All the Javers library has support to only Java 7, I was in a situation since I want this to be used for a Java 6 project so I happened to take the source and change in a way it works for Java 6 below is the github code.

    https://github.com/sand3sh/javers-forJava6

    Jar link: https://github.com/sand3sh/javers-forJava6/blob/master/build/javers-forjava6.jar

    I have only changed the Java 7 supported '<>' inherent cast conversions to Java 6 support I dont gurantee all the functionalities will work since I have commented few unnecessary code for me it works for all custom objects comparision.

提交回复
热议问题