org.jtheque.utils.bean
Class HashCodeUtils

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

public final class HashCodeUtils
extends Object

Author:
Baptiste Wicht

Method Summary
static int hashCode(Object bean)
          Generate a hash code for the bean.
static int hashCode(Object bean, String... properties)
          Return the hash code of an object, using the properties in the given list.
static int hashCodeDirect(Object... properties)
          Return the hash code of an object, using the properties in the given list.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

hashCode

public static int hashCode(Object bean)
Generate a hash code for the bean.

Note : The properties of the Object class are not retrieved.

Parameters:
bean - The bean.
Returns:
A hash code based on all the properties of the bean.

hashCode

public static int hashCode(Object bean,
                           String... properties)
Return the hash code of an object, using the properties in the given list.

Parameters:
bean - The bean to generate the hash code from.
properties - The properties to use to generate the hash code.
Returns:
The hash code of the bean . If there is no properties, the hash code will be 17.

hashCodeDirect

public static int hashCodeDirect(Object... properties)
Return the hash code of an object, using the properties in the given list.

Parameters:
properties - The properties to use to generate the hash code.
Returns:
The hash code of the bean . If there is no properties, the hash code will be 17.


Copyright © 2010 JTheque. All Rights Reserved.