Class CurrentState


  • @ThreadSafe
    public final class CurrentState
    extends java.lang.Object
    The current state base implementation for stats and tags.
    • Field Detail

      • currentInternalState

        private final java.util.concurrent.atomic.AtomicReference<CurrentState.InternalState> currentInternalState
    • Constructor Detail

      • CurrentState

        public CurrentState​(CurrentState.State defaultState)
        Constructs a new CurrentState.
        Parameters:
        defaultState - the default initial state.
    • Method Detail

      • get

        public CurrentState.State get()
        Returns the current state and updates the status as being read.
        Returns:
        the current state and updates the status as being read.
      • getInternal

        public CurrentState.State getInternal()
        Returns the current state without updating the status as being read.
        Returns:
        the current state without updating the status as being read.
      • set

        public boolean set​(CurrentState.State state)
        Sets current state to the given state. Returns true if the current state is changed, false otherwise.
        Parameters:
        state - the state to be set.
        Returns:
        true if the current state is changed, false otherwise.