public class EqualsCheckerArray extends AbstractEqualsChecker<Object>
EqualsChecker that recursively checks arrays based on a given
EqualsChecker delegate. So if two objects should be checked for equality
that are both arrays of the same kind, this implementation will check if they have the same length and then
recursively check the contained elements. For objects of other types it will
delegate to the EqualsChecker given at construction. This way you can simply check if two arrays have the
same or equal elements.| Modifier and Type | Field and Description |
|---|---|
private EqualsChecker<Object> |
delegate
The delegate to check regular objects.
|
private static long |
serialVersionUID |
| Constructor and Description |
|---|
EqualsCheckerArray(EqualsChecker<Object> delegate)
The constructor.
|
| Modifier and Type | Method and Description |
|---|---|
protected boolean |
isEqualNotNull(Object value1,
Object value2)
Called from
AbstractEqualsChecker.isEqual(Object, Object) if objects are both NOT same and NOT null. |
protected boolean |
isEqualPrimitiveArray(Object value1,
Object value2)
This method is the part of
isEqualNotNull(Object, Object) for primitive arrays. |
isEqualprivate static final long serialVersionUID
private final EqualsChecker<Object> delegate
public EqualsCheckerArray(EqualsChecker<Object> delegate)
delegate - is the EqualsChecker used to check objects other than arrays.protected boolean isEqualNotNull(Object value1, Object value2)
AbstractEqualsCheckerAbstractEqualsChecker.isEqual(Object, Object) if objects are both NOT same and NOT null.isEqualNotNull in class AbstractEqualsChecker<Object>value1 - is the first value to check.value2 - is the first value to check.true if the given values are considered as equal, false otherwise.protected boolean isEqualPrimitiveArray(Object value1, Object value2)
isEqualNotNull(Object, Object) for primitive arrays.value1 - is the first value to check.value2 - is the first value to check.true if the given values are considered as equal, false otherwise.Copyright © 2001–2016 mmm-Team. All rights reserved.