T - 这个对象可能被区分的对象类型public interface Differentable<T>
Diffable类与其他对象进行比较,以了解它们之间的差异。
检索到的DifferentResult对象可以查询差异列表,也可以使用DifferentResult.toString()打印
当且仅当d1.equals(d2)表示d1.diff(d2) == ""时,差异的计算与= 一致
强烈建议实现与equals一致,以避免混淆。注意,null不是任何类的实例,
d1.diff(null)应该抛出NullPointerException
Assert.assertEquals(expected.diff(result), expected, result);
| Modifier and Type | Method and Description |
|---|---|
DifferentResult |
diff(T obj)
检索此对象与提供的对象之间的差异列表
|
DifferentResult diff(T obj)
obj - diff的对象可以是nullCopyright © 2020. All rights reserved.