Joda System API

org.joda.property.impl
Class BeanTools

java.lang.Object
  |
  +--org.joda.property.impl.BeanTools

public class BeanTools
extends java.lang.Object

Basic utility functionality operating on beans.

Author:
Stephen Colebourne

Constructor Summary
BeanTools()
           
 
Method Summary
static boolean equalsDeep(Bean bean1, Bean bean2)
          Compares two Beans, taking into account their own properties including linking properties, processing recursively.
static boolean equalsShallow(Bean bean1, Bean bean2)
          Compares two Beans, based only on their own property values.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BeanTools

public BeanTools()
Method Detail

equalsShallow

public static boolean equalsShallow(Bean bean1,
                                    Bean bean2)
Compares two Beans, based only on their own property values. Links to other Beans are ignored.

Parameters:
bean1 - first bean
bean2 - second bean
Returns:
true if the beans are equal

equalsDeep

public static boolean equalsDeep(Bean bean1,
                                 Bean bean2)
Compares two Beans, taking into account their own properties including linking properties, processing recursively.

The method checks for beans which hold references to already checked beans to avoid infinite recursion.

Parameters:
bean1 - first bean
bean2 - second bean
Returns:
true if the beans are equal

Joda System API

Copyright © 2001-2003 Stephen Colebourne. All Rights Reserved.