[
https://issues.apache.org/jira/browse/LANG-1233?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15295472#comment-15295472
]
ASF GitHub Bot commented on LANG-1233:
--------------------------------------
Github user PascalSchumacher commented on a diff in the pull request:
https://github.com/apache/commons-lang/pull/151#discussion_r64146221
--- Diff: src/main/java/org/apache/commons/lang3/builder/DiffBuilder.java
---
@@ -942,6 +942,59 @@ public DiffBuilder append(final String fieldName,
final Object[] lhs,
/**
* <p>
+ * Append diffs from another {@code DiffResult}.
+ * </p>
+ *
+ * <p>
+ * This method is useful if you want to compare properties which are
+ * themselves Diffable and would like to know which specific part of
+ * it is different.
+ * </p>
+ *
+ * <pre>
+ * public class Person implements Diffable<Person> {
+ * String name;
+ * Address address; // implements Diffable<Address>
+ *
+ * ...
+ *
+ * public DiffResult diff(Person obj) {
+ * return new DiffBuilder(this, obj,
ToStringStyle.SHORT_PREFIX_STYLE)
+ * .append("name", this.name, obj.name)
+ * .append("address", this.address.diff(obj.address))
+ * .build();
+ * }
+ * }
+ * </pre>
+ *
+ * @param fieldName
+ * the field name
+ * @param diffResult
+ * the {@code DiffResult} to append
+ * @return this
--- End diff --
Hi Nick,
please add `@since` and `@throws` tags.
Thanks!
> DiffBuilder add method to allow appending from a DiffResult
> -----------------------------------------------------------
>
> Key: LANG-1233
> URL: https://issues.apache.org/jira/browse/LANG-1233
> Project: Commons Lang
> Issue Type: Improvement
> Components: lang.builder.*
> Reporter: Pascal Schumacher
>
> Pull request with the feature:
> [https://github.com/apache/commons-lang/pull/122]
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)