GWT 2.1.0

com.google.gwt.editor.client
Class AutoBeanUtils

java.lang.Object
  extended by com.google.gwt.editor.client.AutoBeanUtils

public final class AutoBeanUtils
extends java.lang.Object

Utility methods for working with AutoBeans.


Method Summary
static java.util.Map<java.lang.String,java.lang.Object> diff(AutoBean<?> a, AutoBean<?> b)
          Returns a map of properties that differ 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>
AutoBean<T>
getAutoBean(U delegate)
          Return the single AutoBean wrapper that is observing the delegate object or null if the parameter is nullor not wrapped by an AutoBean.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

diff

public static java.util.Map<java.lang.String,java.lang.Object> diff(AutoBean<?> a,
                                                                    AutoBean<?> b)
Returns a map of properties that differ 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.

Parameters:
a - an AutoBean
b - an AutoBean
Returns:
a Map of differing properties

getAllProperties

public 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. The returned map is mutable, but editing it will not have any effect on the bean that produced it.

Parameters:
bean - an AutoBean
Returns:
a Map of the bean's properties

getAutoBean

public static <T,U extends T> AutoBean<T> getAutoBean(U delegate)
Return the single AutoBean wrapper that is observing the delegate object or null if the parameter is nullor not wrapped by an AutoBean.

Parameters:
delegate - a delegate object, or null
Returns:
the AutoBean wrapper for the delegate, or null

GWT 2.1.0