Package org.apache.juneau.utils
Class BeanDiff
java.lang.Object
org.apache.juneau.utils.BeanDiff
Utility class for comparing two versions of a POJO.
See Also:
-
Nested Class Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic <T> BeanDiff.Builder<T>
create
(T first, T second) Create a new builder for this class.getV1()
Returns the differences in the first bean.getV2()
Returns the differences in the second bean.boolean
hasDiffs()
Returnstrue if the beans had differences.toString()
-
Constructor Details
-
BeanDiff
Constructor.- Type Parameters:
T
- The bean types.- Parameters:
bc
- The bean context to use for comparing beans.first
- The first bean to compare.second
- The second bean to compare.include
- Optional properties to include in the comparison.
Ifnull , all properties are included.exclude
- Optional properties to exclude in the comparison.
Ifnull , no properties are excluded.
-
-
Method Details
-
create
Create a new builder for this class.- Type Parameters:
T
- The bean types.- Parameters:
first
- The first bean to compare.second
- The second bean to compare.- Returns:
- A new builder.
-
hasDiffs
Returnstrue if the beans had differences.- Returns:
true if the beans had differences.
-
getV1
Returns the differences in the first bean.- Returns:
- The differences in the first bean.
-
getV2
Returns the differences in the second bean.- Returns:
- The differences in the second bean.
-
toString
-