Author: bleny Date: 2011-09-01 14:23:57 +0200 (Thu, 01 Sep 2011) New Revision: 2200 Url: http://nuiton.org/repositories/revision/nuiton-utils/2200 Log: #1728: add diffExluding and @since tag Modified: trunk/nuiton-utils/src/main/java/org/nuiton/util/beans/Binder.java Modified: trunk/nuiton-utils/src/main/java/org/nuiton/util/beans/Binder.java =================================================================== --- trunk/nuiton-utils/src/main/java/org/nuiton/util/beans/Binder.java 2011-09-01 10:09:16 UTC (rev 2199) +++ trunk/nuiton-utils/src/main/java/org/nuiton/util/beans/Binder.java 2011-09-01 12:23:57 UTC (rev 2200) @@ -445,11 +445,28 @@ * @param target a bean of type O * @return a list with all the properties which values differ in source * and target. Properties with equal values are not included. + * @since 2.3 */ public List<PropertyDiff> diff(I source, O target) { return diff(source, target, false); } + /** Compare two beans property by property according to the model. + * + * List contains one element per property with different values (according + * to the result of an equals() call) + * + * @param source a bean of type I + * @param target a bean of type O + * @return a list with all the properties which values differ in source + * and target. Properties with equal values and excluded properties will + * not be contained in the result + * @since 2.3 + */ + public List<PropertyDiff> diffExcluding(I source, O target, String... propertyNames) { + return diff(source, target, true, propertyNames); + } + /** * Get the model of the binder. *
participants (1)
-
bleny@users.nuiton.org