VALUE
- is the generic type of the values to check
.public abstract class AbstractEqualsChecker<VALUE> extends Object implements EqualsChecker<VALUE>, Serializable
EqualsChecker
. It contains the handling of null
values.Modifier and Type | Field and Description |
---|---|
private static long |
serialVersionUID |
Constructor and Description |
---|
AbstractEqualsChecker()
The constructor.
|
Modifier and Type | Method and Description |
---|---|
boolean |
isEqual(VALUE value1,
VALUE value2)
This method determines if the two given objects are
equal to each other in a way
semantically defined by this implementation. |
protected abstract boolean |
isEqualNotNull(VALUE value1,
VALUE value2)
Called from
isEqual(Object, Object) if objects are both NOT same and NOT null. |
private static final long serialVersionUID
public final boolean isEqual(VALUE value1, VALUE value2)
EqualsChecker
equal
to each other in a way
semantically defined by this implementation. An implementation must fulfill the contract of the method
Object.equals(Object)
. This means it is:
isEquals(x, x) == true
, especially: isEquals(null, null) == true
isEquals(x, y) == isEquals(y, x)
(isEquals(x, y) == isEquals(y, z) == true)
implies isEquals(x, z)
isEquals(x, y)
will always return the same result if
x
and y
are unchanged.for all x != null: isEquals(x, null) == isEquals(null, x) == false
isEqual
in interface EqualsChecker<VALUE>
value1
- is the first value.value2
- is the second value.true
if both values are null
or both are NOT null
and equal to each other in the
way defined by this EqualsChecker
implementation, false
otherwise.protected abstract boolean isEqualNotNull(VALUE value1, VALUE value2)
isEqual(Object, Object)
if objects are both NOT same and NOT null.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.