org.jtheque.utils.bean
Class EqualsUtils

java.lang.Object
  extended by org.jtheque.utils.bean.EqualsUtils

public final class EqualsUtils
extends Object

An utility class for equality test.

Author:
Baptiste Wicht

Method Summary
static boolean areEqualsDirect(Object bean, Object other, Object... properties)
          Test if the two objects are equals.
static boolean areNotEquals(Object object, Object other)
          Test if 2 object are not equals.
static boolean areNotSameFile(File file, File other)
          Test if 2 files are not the sames files.
static boolean areObjectIncompatible(Object object, Object other)
          Test if 2 objects are incompatible for equality test.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

areObjectIncompatible

public static boolean areObjectIncompatible(Object object,
                                            Object other)
Test if 2 objects are incompatible for equality test.

Parameters:
object - The first object to test.
other - The second object to test.
Returns:
true if the objects are incompatibles else false.

areNotEquals

public static boolean areNotEquals(Object object,
                                   Object other)
Test if 2 object are not equals.

Parameters:
object - The first object to test.
other - The second object to test.
Returns:
true if the objects aren't equals else false.

areEqualsDirect

public static boolean areEqualsDirect(Object bean,
                                      Object other,
                                      Object... properties)
Test if the two objects are equals.

Parameters:
bean - The bean to test.
other - The other bean to test for equality with the first one.
properties - The properties to compare one by one. The properties n is compared to the property n + (properties.length / 2). This array must be pair.
Returns:
A boolean indicating if the two objects are equals or not.

areNotSameFile

public static boolean areNotSameFile(File file,
                                     File other)
Test if 2 files are not the sames files.

Parameters:
file - The first file to test.
other - The second file to test.
Returns:
true if the files are not the same else false.


Copyright © 2010 JTheque. All Rights Reserved.