Top Description Fields Constructors Methods
com.rometools.rome.feed.impl

public Class EqualsBean

extends Object
Class Inheritance
Imports
java.lang.reflect.Array, .Method, java.util.List

Provides deep Bean equals() and hashCode() functionality for Java Beans.

It works on all read/write properties, recursively. It support all primitive types, Strings, Collections, bean-like objects and multi-dimensional arrays of any of them.

The hashcode is calculated by getting the hashcode of the Bean String representation.

Field Summary

Modifier and TypeField and Description
private static final Object[]

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public static boolean

Returns:

true if the object passed in the constructor is equal to the 'obj' object.
beanEquals
(Class<?> beanClass, final Object
The reference object with which to compare.
obj1
,
final Object
The object to which to compare.
obj2
)

Indicates whether some other object is "equal to" the object passed in the constructor, as defined by the Object equals() method.

public static int

Returns:

the hashcode of the bean object.
beanHashCode
(Object obj)

Returns the hashcode for the object passed in the constructor.

private static boolean
doEquals(final Object obj1, final Object obj2)

private static boolean
equalsArray(final Object array1, final Object array2)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

NO_PARAMSback to summary
private static final Object[] NO_PARAMS

Constructor Detail

EqualsBeanback to summary
private EqualsBean()

Method Detail

beanEqualsback to summary
public static boolean beanEquals(Class<?> beanClass, final Object obj1, final Object obj2)

Indicates whether some other object is "equal to" the object passed in the constructor, as defined by the Object equals() method.

To be used by classes using EqualsBean in a delegation pattern,

Parameters
obj1:Object

The reference object with which to compare.

obj2:Object

The object to which to compare.

Returns:boolean

true if the object passed in the constructor is equal to the 'obj' object.

beanHashCodeback to summary
public static int beanHashCode(Object obj)

Returns the hashcode for the object passed in the constructor.

It follows the contract defined by the Object hashCode() method.

The hashcode is calculated by getting the hashcode of the Bean String representation.

To be used by classes using EqualsBean in a delegation pattern,

Returns:int

the hashcode of the bean object.

doEqualsback to summary
private static boolean doEquals(final Object obj1, final Object obj2)
equalsArrayback to summary
private static boolean equalsArray(final Object array1, final Object array2)