org.squirrelframework.foundation.fsm.TransitionResult Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of squirrel-foundation Show documentation
Show all versions of squirrel-foundation Show documentation
foundation module of squirrel framework which provided event driven infrastructure and a finite state machine implementation.
package org.squirrelframework.foundation.fsm;
import java.util.List;
/**
* This class will hold all the transition result including result of nested transitions.
*
* @author Henry.He
*
* @param state machine type
* @param state type
* @param event type
* @param context type
*/
public interface TransitionResult, S, E, C> {
/**
* If any transition including all nested transitions is accepted, the parent transition is
* accepted accordingly.
* @return true if transition is accepted; false if transition result is declined
*/
boolean isAccepted();
/**
* If all transitions including all nested transitions is declined, the parent transition is
* declined accordingly.
* @return false if transition is accepted; true if transition result is declined
*/
boolean isDeclined();
/**
* Set transition accepted or not.
* @param accepted
* @return transition result
*/
TransitionResult setAccepted(boolean accepted);
/**
* @return target state of transition
*/
ImmutableState getTargetState();
/**
* Set target state of transition
* @param targetState
* @return transition result
*/
TransitionResult setTargetState(ImmutableState targetState);
/**
* @return parent transition result
*/
TransitionResult getParentResut();
/**
* Set parent transition result
* @param result
* @return transition result
*/
TransitionResult setParent(TransitionResult result);
/**
* @return nested transition result of current transition
*/
List> getSubResults();
/**
* @return all the accepted transition result of current transition
*/
List> getAcceptedResults();
}