diff --git a/src/main/java/ch/unibas/dmi/dbis/cs108/casono/client/network/LoginResult.java b/src/main/java/ch/unibas/dmi/dbis/cs108/casono/client/network/LoginResult.java new file mode 100644 index 0000000..29dff70 --- /dev/null +++ b/src/main/java/ch/unibas/dmi/dbis/cs108/casono/client/network/LoginResult.java @@ -0,0 +1,38 @@ +package ch.unibas.dmi.dbis.cs108.casono.client.network; + +/** + * Result of a successful login request. + * + *
Holds the username assigned by the server and the server-side id as a string (UUID). The + * client previously attempted to parse the id as an integer which failed when the server returned a + * UUID; this class therefore stores the id as a {@link String}. + */ +public class LoginResult { + private final String username; + private final String id; + + /** + * Create a login result. + * + * @param username the assigned username + * @param id the assigned id (UUID string) returned by the server + */ + public LoginResult(String username, String id) { + this.username = username; + this.id = id; + } + + /** + * @return the assigned username + */ + public String getUsername() { + return username; + } + + /** + * @return the assigned id as returned by the server (UUID string) + */ + public String getId() { + return id; + } +}