Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.apache.tiles
Class CompareUtil

    java.lang.Object
      org.apache.tiles.CompareUtil

    public final class CompareUtil

extends java.lang.Object

Utilities to work with comparation between objects.

Since:
  2.2.0
Version:
  $Rev: 787720 $ $Date: 2009-06-23 17:39:21 +0200 (mar, 23 giu 2009) $

Method Summary
`static boolean` | `nullSafeEquals(java.lang.Object obj1, java.lang.Object obj2)` Checks if two objects (eventually null) are the same.
`static int` | `nullSafeHashCode(java.lang.Object obj)` Returns `0` if the object is null, the hash code of the object otherwise.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Method Detail

### nullSafeEquals

    public static boolean nullSafeEquals(java.lang.Object obj1,
                                         java.lang.Object obj2)

  Checks if two objects (eventually null) are the same. They are considered the same even if they are both null.

  Parameters:
    `obj1` - The first object to check.
    `obj2` - The second object to check.
  Returns:
    `true` if the objects are the same.
  Since:
    2.2.0

### nullSafeHashCode

    public static int nullSafeHashCode(java.lang.Object obj)

  Returns `0` if the object is null, the hash code of the object otherwise.

  Parameters:
    `obj` - The object from which the hash code must be calculated..
  Returns:
    The hash code.
  Since:
    2.2.0

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2001-2010 Apache Software Foundation. All Rights Reserved.