| java.lang.Object com.sun.syndication.feed.impl.EqualsBean
EqualsBean | public class EqualsBean implements Serializable(Code) | | 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.
author: Alejandro Abdelnur |
Constructor Summary | |
protected | EqualsBean(Class beanClass) Default constructor. | public | EqualsBean(Class beanClass, Object obj) Creates a EqualsBean to be used in a delegation pattern. |
Method Summary | |
public boolean | beanEquals(Object obj) 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,
See Also: EqualsBean.EqualsBean(Class,Object) See Also: constructor. See Also: Parameters: obj - he reference object with which to compare.
| public int | beanHashCode() Returns the hashcode for the object passed in the constructor. | public boolean | equals(Object obj) Indicates whether some other object is "equal to" this object as defined by the Object equals() method.
To be used by classes extending EqualsBean. | public int | hashCode() Returns the hashcode for this object.
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 extending EqualsBean. |
EqualsBean | protected EqualsBean(Class beanClass)(Code) | | Default constructor.
To be used by classes extending EqualsBean only.
Parameters: beanClass - the class/interface to be used for property scanning. |
EqualsBean | public EqualsBean(Class beanClass, Object obj)(Code) | | Creates a EqualsBean to be used in a delegation pattern.
For example:
public class Foo implements FooI {
private EqualsBean _equalsBean;
public Foo() {
_equalsBean = new EqualsBean(FooI.class);
}
public boolean equals(Object obj) {
return _equalsBean.beanEquals(obj);
}
public int hashCode() {
return _equalsBean.beanHashCode();
}
}
Parameters: beanClass - the class/interface to be used for property scanning. Parameters: obj - object bean to test equality. |
beanEquals | public boolean beanEquals(Object obj)(Code) | | 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,
See Also: EqualsBean.EqualsBean(Class,Object) See Also: constructor. See Also: Parameters: obj - he reference object with which to compare. true if the object passed in the constructor is equal to the 'obj' object.
|
beanHashCode | public int beanHashCode()(Code) | | 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,
See Also: EqualsBean.EqualsBean(Class,Object) See Also: constructor. See Also: the hashcode of the bean object. |
equals | public boolean equals(Object obj)(Code) | | Indicates whether some other object is "equal to" this object as defined by the Object equals() method.
To be used by classes extending EqualsBean. Although it works also for classes using
EqualsBean in a delegation pattern, for correctness those classes should use the
See Also: EqualsBean.beanEquals(Object) See Also: beanEquals method. See Also: Parameters: obj - he reference object with which to compare. true if 'this' object is equal to the 'other' object.
|
hashCode | public int hashCode()(Code) | | Returns the hashcode for this object.
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 extending EqualsBean. Although it works also for classes using
EqualsBean in a delegation pattern, for correctness those classes should use the
See Also: EqualsBean.beanHashCode() See Also: beanHashCode method. See Also: the hashcode of the bean object. |
|
|