Interface ActionSequence<M>

  • Type Parameters:
    M - The type of the model

    @API(status=MAINTAINED,
         since="1.0")
    public interface ActionSequence<M>
    A sequence of Actions that can be run with a model of type M
    • Method Detail

      • runActions

        java.util.List<Action<M>> runActions()
      • run

        M run​(M model)
      • size

        @API(status=EXPERIMENTAL,
             since="1.3.3")
        int size()
      • withInvariant

        @API(status=MAINTAINED,
             since="1.4.0")
        ActionSequence<M> withInvariant​(@Nullable
                                        java.lang.String label,
                                        Invariant<M> invariant)
        Add a labelled invariant to a sequence.
        Parameters:
        label - will show up in error messages when the invariant fails
        invariant - will be checked after each successful invocation of run(Object)
        Returns:
        the same sequence instance
        See Also:
        withInvariant(Invariant)
      • finalModel

        M finalModel()
      • peek

        @API(status=EXPERIMENTAL,
             since="1.2.5")
        ActionSequence<M> peek​(java.util.function.Consumer<M> modelPeeker)
        Peek into the model of a running sequence. The modelPeeker will be called after each successful invocation of run(Object) but before checking invariants.
        Parameters:
        modelPeeker -
        Returns:
        the same sequence instance