You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Consider a class A that has a field b of type List<C>. The type C, in turn, has a large number of fields c1, c2, c3,..., but two C objects are considered "same" if their c1 fields are equal (perhaps C is a data object and c1 is its identifier field).
These rules can be implemented by a custom IdentityStrategy like this:
However, the diff summary generated by PrintingVisitor for two A objects is often overly long:
Property at path '/b[C [ \ c1 = "id123" \ c2 = "foo" \ c3= "bar" \ c4 = D [ \ d1 = "baz" \ d2 = "quux" \ d3 = E [ \ e1 = "xxx" \ e2 = "yyy" \ ] \ ] \ ]]/c4/d3/e2' has changed from [ yyy ] to [ zzz ]
It is not necessary to print the entire toString representation of the C type (which may include lots of nested objects), if the C object can be matched with its counterpart by a single field.
The text was updated successfully, but these errors were encountered:
Consider a class
A
that has a fieldb
of typeList<C>
. The typeC
, in turn, has a large number of fieldsc1
,c2
,c3
,..., but twoC
objects are considered "same" if theirc1
fields are equal (perhapsC
is a data object andc1
is its identifier field).These rules can be implemented by a custom
IdentityStrategy
like this:However, the diff summary generated by PrintingVisitor for two
A
objects is often overly long:It is not necessary to print the entire toString representation of the
C
type (which may include lots of nested objects), if theC
object can be matched with its counterpart by a single field.The text was updated successfully, but these errors were encountered: