| 4 | import java.util.Objects; |
| 5 | |
| 6 | public class Address { |
| 7 | public final UniqueId nodeId; |
| 8 | public final String ip; |
| 9 | public final int port; |
| 10 | |
| 11 | public Address(UniqueId nodeId, String ip, int port) { |
| 12 | this.nodeId = nodeId; |
| 13 | this.ip = ip; |
| 14 | this.port = port; |
| 15 | } |
| 16 | |
| 17 | @Override |
| 18 | public boolean equals(Object obj) { |
| 19 | if (obj == null) { |
| 20 | return false; |
| 21 | } |
| 22 | |
| 23 | if (!this.getClass().equals(obj.getClass())) { |
| 24 | return false; |
| 25 | } |
| 26 | |
| 27 | Address other = (Address) obj; |
| 28 | return this.nodeId.equals(other.nodeId) && this.ip.equals(other.ip) && this.port == other.port; |
| 29 | } |
| 30 | |
| 31 | @Override |
| 32 | public int hashCode() { |
| 33 | return Objects.hash(nodeId, ip, port); |
| 34 | } |
| 35 | } |
no outgoing calls
searching dependent graphs…