public final class AutoBeanUtils
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
static boolean |
deepEquals(AutoBean<?> a,
AutoBean<?> b)
Compare two graphs of AutoBeans based on values.
|
static java.util.Map<java.lang.String,java.lang.Object> |
diff(AutoBean<?> a,
AutoBean<?> b)
Returns a map of properties that differ (via
Object.equals(Object) )
between two AutoBeans. |
static java.util.Map<java.lang.String,java.lang.Object> |
getAllProperties(AutoBean<?> bean)
Returns a map that is a copy of the properties contained in an AutoBean.
|
static <T,U extends T> |
getAutoBean(U delegate)
Return the single AutoBean wrapper that is observing the delegate object or
null if the parameter is null or not wrapped by an AutoBean. |
(package private) static boolean |
sameOrEquals(java.lang.Object value,
java.lang.Object otherValue,
java.util.Map<com.google.web.bindery.autobean.shared.AutoBeanUtils.PendingComparison,com.google.web.bindery.autobean.shared.AutoBeanUtils.Comparison> pending)
Compare two AutoBeans, this method has the type fan-out.
|
public static boolean deepEquals(AutoBean<?> a, AutoBean<?> b)
Splittables
are compared by valueThis will work for both simple and wrapper AutoBeans.
This method may crawl the entire object graph reachable from the input parameters and may be arbitrarily expensive to compute.
public static java.util.Map<java.lang.String,java.lang.Object> diff(AutoBean<?> a, AutoBean<?> b)
Object.equals(Object)
)
between two AutoBeans. The keys are property names and the values are the
value of the property in b
. Properties present in
a
but missing in b
will be represented by
null
values. This implementation will compare AutoBeans of
different parameterizations, although the diff produced is likely
meaningless.
This will work for both simple and wrapper AutoBeans.
public static java.util.Map<java.lang.String,java.lang.Object> getAllProperties(AutoBean<?> bean)
bean
- an AutoBean
Map
of the bean's propertiespublic static <T,U extends T> AutoBean<T> getAutoBean(U delegate)
null
if the parameter is null
or not wrapped by an AutoBean.delegate
- a delegate object, or null
AutoBean
wrapper for the delegate, or null
static boolean sameOrEquals(java.lang.Object value, java.lang.Object otherValue, java.util.Map<com.google.web.bindery.autobean.shared.AutoBeanUtils.PendingComparison,com.google.web.bindery.autobean.shared.AutoBeanUtils.Comparison> pending)