Package dev.deepcore.challenge.session
Class SessionState
java.lang.Object
dev.deepcore.challenge.session.SessionState
Holds current challenge session phase and shared timing state.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumRepresents the top-level lifecycle phases of a challenge session. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetPhase()Returns the current session phase.booleanis(SessionState.Phase phase) Returns whether the current session phase matches the supplied phase.Returns the current phase name as a lowercase string.voidsetPhase(SessionState.Phase phase) Sets the current session phase.timing()Returns mutable timing state for the current session lifecycle.
-
Constructor Details
-
SessionState
public SessionState()
-
-
Method Details
-
getPhase
Returns the current session phase.- Returns:
- active lifecycle phase for the current challenge session
-
setPhase
Sets the current session phase.- Parameters:
phase- lifecycle phase to set as current
-
is
Returns whether the current session phase matches the supplied phase.- Parameters:
phase- lifecycle phase to compare against the current phase- Returns:
- true when the session is currently in the supplied phase
-
phaseNameLowercase
Returns the current phase name as a lowercase string.- Returns:
- lowercase phase name for UI and logging output
-
timing
Returns mutable timing state for the current session lifecycle.- Returns:
- timing state object backing run and pause timestamps
-