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