类 StateTransition


  • public final class StateTransition
    extends java.lang.Object
    Value object representing a potential transition from one State to another. The originating State name and the next State to execute are linked by a pattern for the exit code of an execution of the originating State.
    从以下版本开始:
    2.0
    作者:
    Dave Syer, Michael Minella, Mahmoud Ben Hassine
    • 方法详细资料

      • createEndStateTransition

        public static StateTransition createEndStateTransition​(State state,
                                                               java.lang.String pattern)
        Create a new end state StateTransition specification. This transition explicitly goes to an end state (i.e. no more processing) if the outcome matches the pattern.
        参数:
        state - the State used to generate the outcome for this transition
        pattern - the pattern to match in the exit status of the State
        返回:
        StateTransition that was created.
      • switchOriginAndDestination

        public static StateTransition switchOriginAndDestination​(StateTransition stateTransition,
                                                                 State state,
                                                                 java.lang.String next)
        Convenience method to switch the origin and destination of a transition, creating a new instance.
        参数:
        stateTransition - an existing state transition
        state - the new state for the origin
        next - the new name for the destination
        返回:
        StateTransition that was created.
      • createStateTransition

        public static StateTransition createStateTransition​(State state,
                                                            @Nullable
                                                            java.lang.String pattern,
                                                            @Nullable
                                                            java.lang.String next)
        Create a new StateTransition specification from one State to another (by name).
        参数:
        state - the State used to generate the outcome for this transition
        pattern - the pattern to match in the exit status of the State (can be null)
        next - the name of the next State to execute (can be null)
        返回:
        StateTransition that was created.
      • getState

        public State getState()
        Public getter for the State.
        返回:
        the State
      • getNext

        public java.lang.String getNext()
        Public getter for the next State name.
        返回:
        the next
      • matches

        public boolean matches​(java.lang.String status)
        Check if the provided status matches the pattern, signalling that the next State should be executed.
        参数:
        status - the status to compare
        返回:
        true if the pattern matches this status
      • isEnd

        public boolean isEnd()
        Check for a special next State signalling the end of a job.
        返回:
        true if this transition goes nowhere (there is no next)
      • toString

        public java.lang.String toString()
        覆盖:
        toString 在类中 java.lang.Object