Class SessionState

java.lang.Object
dev.deepcore.challenge.session.SessionState

public final class SessionState extends Object
Holds current challenge session phase and shared timing state.
  • Constructor Details

    • SessionState

      public SessionState()
  • Method Details

    • getPhase

      public SessionState.Phase getPhase()
      Returns the current session phase.
      Returns:
      active lifecycle phase for the current challenge session
    • setPhase

      public void setPhase(SessionState.Phase phase)
      Sets the current session phase.
      Parameters:
      phase - lifecycle phase to set as current
    • is

      public boolean is(SessionState.Phase phase)
      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

      public String phaseNameLowercase()
      Returns the current phase name as a lowercase string.
      Returns:
      lowercase phase name for UI and logging output
    • timing

      public SessionTimingState timing()
      Returns mutable timing state for the current session lifecycle.
      Returns:
      timing state object backing run and pause timestamps