forked from External/mage
Added hashCode and equal to main server objects
This commit is contained in:
parent
21eb420c16
commit
27a454f042
14 changed files with 614 additions and 31 deletions
|
|
@ -1,10 +1,11 @@
|
|||
package mage.view;
|
||||
|
||||
import mage.cards.Card;
|
||||
import mage.game.command.Emblem;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
import mage.cards.Card;
|
||||
import mage.game.command.Emblem;
|
||||
|
||||
/**
|
||||
* @author noxx
|
||||
|
|
@ -54,4 +55,31 @@ public class EmblemView implements CommandObjectView, Serializable {
|
|||
public List<String> getRules() {
|
||||
return rules;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(final Object o) {
|
||||
if (this == o) return true;
|
||||
if (o == null || getClass() != o.getClass()) return false;
|
||||
|
||||
final EmblemView that = (EmblemView) o;
|
||||
|
||||
if (!getId().equals(that.getId())) return false;
|
||||
if (getName() != null ? !getName().equals(that.getName()) : that.getName() != null)
|
||||
return false;
|
||||
if (getExpansionSetCode() != null ? !getExpansionSetCode().equals(that
|
||||
.getExpansionSetCode()) : that.getExpansionSetCode() != null)
|
||||
return false;
|
||||
return getRules() != null ? getRules().equals(that.getRules()) : that.getRules() == null;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
int result = getId().hashCode();
|
||||
result = 31 * result + (getName() != null ? getName().hashCode() : 0);
|
||||
result = 31 * result + (getExpansionSetCode() != null ? getExpansionSetCode().hashCode()
|
||||
: 0);
|
||||
result = 31 * result + (getRules() != null ? getRules().hashCode() : 0);
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue