9
0
mirror of https://github.com/WiIIiam278/HuskSync.git synced 2025-12-25 17:49:20 +00:00

Cleanup user logic

This commit is contained in:
William
2022-07-11 12:48:41 +01:00
parent 54553069bf
commit ff1c8cddb5

View File

@@ -1,28 +1,34 @@
package net.william278.husksync.player;
import com.google.gson.annotations.SerializedName;
import org.jetbrains.annotations.NotNull;
import java.util.UUID;
/**
* Represents a user who has their data synchronised by HuskSync
*/
public class User {
@SerializedName("username")
public String username;
@SerializedName("uuid")
/**
* The user's unique account ID
*/
public UUID uuid;
/**
* The user's username
*/
public String username;
public User(@NotNull UUID uuid, @NotNull String username) {
this.username = username;
this.uuid = uuid;
}
@Override
public boolean equals(Object obj) {
if (obj instanceof User other) {
public boolean equals(Object object) {
if (object instanceof User other) {
return this.uuid.equals(other.uuid);
}
return super.equals(obj);
return super.equals(object);
}
}