Package NTNU.IDATT1002.service
Class ApplicationState
java.lang.Object
NTNU.IDATT1002.service.ApplicationState
public final class ApplicationState
extends java.lang.Object
Class Application State. Keeps a record of the global application state, such as the current logged in user.
-
Constructor Summary
Constructors Constructor Description ApplicationState()
-
Method Summary
Modifier and Type Method Description static User
getCurrentUser()
Retrieve the current logged in user if present, or retrieve an anonymous user.static void
setCurrentUser(User currentUser)
-
Constructor Details
-
ApplicationState
public ApplicationState()
-
-
Method Details
-
setCurrentUser
-
getCurrentUser
Retrieve the current logged in user if present, or retrieve an anonymous user.- Returns:
- the current user.
- Throws:
java.lang.IllegalArgumentException
- if neither the current user nor the anonymous user are present.
-