Class CurrentState

java.lang.Object
io.opencensus.implcore.internal.CurrentState

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

  • Constructor Details

    • CurrentState

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

    • 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.