com.twitter.common.util
Class StateMachine.Rule.AllowedTransition<T>

java.lang.Object
  extended by com.twitter.common.util.StateMachine.Rule.AllowedTransition<T>
Type Parameters:
T - State type.
Enclosing class:
StateMachine.Rule<T>

public static class StateMachine.Rule.AllowedTransition<T>
extends Object

A helper class when building a transition rule, to define the allowed transitions.


Method Summary
 StateMachine.Rule<T> noTransitions()
          Allows no transitions to be performed from this state.
 StateMachine.Rule<T> to(T state)
          Associates a single allowed transition with this state.
 StateMachine.Rule<T> to(T state, T... additionalStates)
          Associates multiple transitions with this state.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

to

public StateMachine.Rule<T> to(T state)
Associates a single allowed transition with this state.

Parameters:
state - Allowed transition state.
Returns:
A new rule that identical to the original, but only allowing a transition to the provided state.

to

public StateMachine.Rule<T> to(T state,
                               T... additionalStates)
Associates multiple transitions with this state.

Parameters:
state - An allowed transition state.
additionalStates - Additional states that may be transitioned to.
Returns:
A new rule that identical to the original, but only allowing a transition to the provided states.

noTransitions

public StateMachine.Rule<T> noTransitions()
Allows no transitions to be performed from this state.

Returns:
The original rule.