67 lines
1.3 KiB
Java
67 lines
1.3 KiB
Java
import java.net.InetAddress;
|
|
|
|
public class RemoteUser {
|
|
|
|
InetAddress addIP;
|
|
int portTCP;
|
|
String pseudo;
|
|
|
|
/*** CONSTRUCTOR of RemoteUser ***/
|
|
public RemoteUser(InetAddress remoteUserIP, int remoteUserPortTCP,String pseudo) {
|
|
this.addIP=remoteUserIP;
|
|
this.portTCP=remoteUserPortTCP;
|
|
this.pseudo=pseudo;
|
|
}
|
|
|
|
/*** GETTERS ***/
|
|
public InetAddress getRemoteUserIP() {
|
|
return addIP;
|
|
}
|
|
public int getRemoteUserPort() {
|
|
return portTCP;
|
|
}
|
|
public String getPseudo() {
|
|
return pseudo;
|
|
}
|
|
|
|
|
|
/*** SETTERS ***/
|
|
public void setRemoteUserIP(InetAddress remoteUserIP) {
|
|
this.addIP = remoteUserIP;
|
|
}
|
|
public void setRemoteUserPort(int remoteUserPort) {
|
|
this.portTCP = remoteUserPort;
|
|
}
|
|
public void setRemotePseudo(String remoteUserpseudo) {
|
|
this.pseudo = remoteUserpseudo;
|
|
}
|
|
|
|
/*** OVERRIDE METHODS ***/
|
|
/*
|
|
* equals
|
|
* @see java.lang.Object#equals(java.lang.Object)
|
|
*/
|
|
@Override
|
|
public boolean equals(Object obj) {
|
|
if (this == obj)
|
|
return true;
|
|
if (obj == null)
|
|
return false;
|
|
if (getClass() != obj.getClass())
|
|
return false;
|
|
RemoteUser other = (RemoteUser) obj;
|
|
if (addIP == null) {
|
|
if (other.addIP != null)
|
|
return false;
|
|
} else if (!addIP.equals(other.addIP))
|
|
return false;
|
|
if (portTCP != other.portTCP)
|
|
return false;
|
|
return true;
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|