com.alibaba.cola.statemachine.State Maven / Gradle / Ivy
package com.alibaba.cola.statemachine;
import com.alibaba.cola.statemachine.impl.TransitionType;
import java.util.Collection;
import java.util.List;
import java.util.Optional;
/**
* State
*
* @param the type of state
* @param the type of event
*
* @author Frank Zhang
* @date 2020-02-07 2:12 PM
*/
public interface State extends Visitable{
/**
* Gets the state identifier.
*
* @return the state identifiers
*/
S getId();
/**
* Add transition to the state
* @param event the event of the Transition
* @param target the target of the transition
* @return
*/
Transition addTransition(E event, State target, TransitionType transitionType);
List> getEventTransitions(E event);
Collection> getAllTransitions();
}