41 lines
981 B
Java
41 lines
981 B
Java
package uulm.teamname.marvelous.server.net;
|
|
|
|
import java.util.Objects;
|
|
|
|
/** The SUID (or Somewhat Unique ID) is the ID described by the Name and ID that the client provides on Connect */
|
|
public class SUID {
|
|
private final String name;
|
|
private final String deviceID;
|
|
|
|
public SUID(String name, String deviceID) {
|
|
this.name = name;
|
|
this.deviceID = deviceID;
|
|
}
|
|
|
|
public String getName() {
|
|
return name;
|
|
}
|
|
|
|
public String getDeviceID() {
|
|
return deviceID;
|
|
}
|
|
|
|
@Override
|
|
public boolean equals(Object o) {
|
|
if (this == o) return true;
|
|
if (o == null || getClass() != o.getClass()) return false;
|
|
SUID suid = (SUID) o;
|
|
return Objects.equals(name, suid.name) && Objects.equals(deviceID, suid.deviceID);
|
|
}
|
|
|
|
@Override
|
|
public int hashCode() {
|
|
return Objects.hash(name, deviceID);
|
|
}
|
|
|
|
@Override
|
|
public String toString() {
|
|
return name + "#" + deviceID;
|
|
}
|
|
}
|