Docs: Write JavaDoc for changed components

This commit is contained in:
Lars Simon Winzer
2026-04-02 14:17:45 +02:00
parent f91fa698f3
commit a9878da3f2
@@ -88,19 +88,31 @@ public class UserRegistry {
} }
/** /**
* Looks up a user by their session ID. * Looks up a user by their {@link SessionId}.
* *
* @param sessionId the session ID to look up * @param sessionId the SessionId to look up
* @return an Optional containing the user, or empty if no user is associated with this session * @return an Optional containing the {@link User}, or empty if no user is associated with this SessionId
*/ */
public Optional<User> getBySessionId(SessionId sessionId) { public Optional<User> getBySessionId(SessionId sessionId) {
return Optional.ofNullable(bySessionId.get(sessionId)); return Optional.ofNullable(bySessionId.get(sessionId));
} }
/**
* Looks up a user by their {@link UserId}.
*
* @param userId the UserId to look up
* @return an Optional containing the {@link User}, or empty if no user is associated with this UserId
*/
public Optional<User> getByUserId(UserId userId) { public Optional<User> getByUserId(UserId userId) {
return Optional.ofNullable(byId.get(userId)); return Optional.ofNullable(byId.get(userId));
} }
/**
* Looks up a user by their username.
*
* @param username the username to look up
* @return an Optional containing the {@link User}, or empty if no user is associated with this username
*/
public Optional<User> getByUsername(String username) { public Optional<User> getByUsername(String username) {
return Optional.ofNullable(byName.get(username)); return Optional.ofNullable(byName.get(username));
} }