Remove need in equals() for explicit type
This commit is contained in:
parent
d93f27d959
commit
f49df2d895
1 changed files with 5 additions and 5 deletions
|
@ -75,11 +75,11 @@ public abstract class TypeAlias<T> {
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
public final boolean equals(final Object o) {
|
public final boolean equals(final Object o) {
|
||||||
if (o instanceof TypeAlias) {
|
if (o instanceof TypeAlias) {
|
||||||
if (((TypeAlias) o).type.equals(type)) {
|
final TypeAlias other = (TypeAlias) o;
|
||||||
return ((TypeAlias<T>) o).map(getValue()::equals);
|
final Object otherValue = other.getValue();
|
||||||
} else {
|
final Class<?> otherValueClass = otherValue.getClass();
|
||||||
return false;
|
return otherValueClass.equals(getValue().getClass())
|
||||||
}
|
&& otherValue.equals(getValue());
|
||||||
}
|
}
|
||||||
return map(o::equals);
|
return map(o::equals);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue