FileDocCategorySizeDatePackage
CompareUtil.javaAPI DocGlassfish v2 API2831Fri May 04 22:31:06 BST 2007com.sun.appserv.management.util.misc

CompareUtil

public final class CompareUtil extends Object
Provides a variety of useful utilities for comparing objects.

Fields Summary
Constructors Summary
private CompareUtil()

		// disallow instantiation
	
Methods Summary
public static booleanobjectsEqual(java.lang.Object o1, java.lang.Object o2)

		boolean	equal	= o1 == o2;
		
		if ( ! equal )
		{
			if ( o1 == null )
			{
				// o1 is null, but o2 is not
				equal	= false;
			}
			else
			{
				equal	= o1.equals( o2 );
				if ( ! equal )
				{
					if ( ClassUtil.objectIsArray( o1 ) )
					{
						equal	= ArrayUtil.arraysEqual( o1, o2 );
					}
				}
			}
		}
		
		return( equal );