mirror of
https://github.com/correl/mage.git
synced 2024-12-24 03:00:14 +00:00
equals method can be simplified
This commit is contained in:
parent
73f9a82938
commit
96b2094370
2 changed files with 5 additions and 3 deletions
|
@ -7,6 +7,8 @@
|
|||
package org.mage.plugins.card.dl.beans.properties;
|
||||
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
import static java.lang.String.*;
|
||||
|
||||
|
||||
|
@ -28,7 +30,7 @@ public abstract class AbstractProperty<T> implements Property<T> {
|
|||
if(!(obj instanceof Property<?>)) return false;
|
||||
Object value = getValue();
|
||||
Object other = ((Property<?>) obj).getValue();
|
||||
return value == other || (value != null && value.equals(other));
|
||||
return Objects.equals(value, other);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -88,10 +88,10 @@ public class CardDownloadData {
|
|||
return false;
|
||||
}
|
||||
final CardDownloadData other = (CardDownloadData) obj;
|
||||
if ((this.name == null) ? (other.name != null) : !this.name.equals(other.name)) {
|
||||
if (!Objects.equals(this.name, other.name)) {
|
||||
return false;
|
||||
}
|
||||
if ((this.set == null) ? (other.set != null) : !this.set.equals(other.set)) {
|
||||
if (!Objects.equals(this.set, other.set)) {
|
||||
return false;
|
||||
}
|
||||
if (!Objects.equals(this.collectorId, other.collectorId) && (this.collectorId == null || !this.collectorId.equals(other.collectorId))) {
|
||||
|
|
Loading…
Reference in a new issue