parent
960b1213fb
commit
9161f69547
@ -0,0 +1,43 @@
|
||||
package model;
|
||||
|
||||
public class ClientAdress {
|
||||
private String ip;
|
||||
private int port;
|
||||
|
||||
public ClientAdress(String ip, int port) {
|
||||
this.ip = ip;
|
||||
this.port = port;
|
||||
}
|
||||
|
||||
public String getIp() {
|
||||
return ip;
|
||||
}
|
||||
|
||||
public int getPort() {
|
||||
return port;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) return true;
|
||||
if (o == null || getClass() != o.getClass()) return false;
|
||||
|
||||
ClientAdress that = (ClientAdress) o;
|
||||
|
||||
if (port != that.port) return false;
|
||||
return ip != null ? ip.equals(that.ip) : that.ip == null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
int result = ip != null ? ip.hashCode() : 0;
|
||||
result = 31 * result + port;
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "[ip='" + ip + '\'' +
|
||||
", port=" + port+"]";
|
||||
}
|
||||
}
|
||||
Loading…
Reference in new issue