check shipyard on equals starport
This commit is contained in:
@@ -32,4 +32,18 @@ public class Shipyard {
|
||||
ships.addAll(unavailables);
|
||||
return ships;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) return true;
|
||||
if (o == null || getClass() != o.getClass()) return false;
|
||||
Shipyard shipyard = (Shipyard) o;
|
||||
return Objects.equals(items, shipyard.items) &&
|
||||
Objects.equals(unavailables, shipyard.unavailables);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(items, unavailables);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package ru.trader.edce.entities;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
public class ShipyardItem {
|
||||
private long id;
|
||||
private String name;
|
||||
@@ -37,4 +39,18 @@ public class ShipyardItem {
|
||||
", basevalue=" + basevalue +
|
||||
"} ";
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) return true;
|
||||
if (o == null || getClass() != o.getClass()) return false;
|
||||
ShipyardItem that = (ShipyardItem) o;
|
||||
return Objects.equals(id, that.id) &&
|
||||
Objects.equals(basevalue, that.basevalue);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(id);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -64,7 +64,8 @@ public class Starport {
|
||||
if (o == null || getClass() != o.getClass()) return false;
|
||||
Starport starport = (Starport) o;
|
||||
return Objects.equals(id, starport.id) &&
|
||||
Objects.equals(commodities, starport.commodities);
|
||||
Objects.equals(commodities, starport.commodities) &&
|
||||
Objects.equals(ships, starport.ships);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user