Class Step

java.lang.Object
nl.pim16aap2.animatedarchitecture.core.tooluser.Step

public final class Step extends Object
Represents a step in a Procedure.

The step can be configured with messages to send to the user as preparation as well as StepExecutors to process the user input.

  • Method Details

    • waitForUserInput

      public boolean waitForUserInput()
      Checks if this type of Step waits for user input or not.

      Most steps will usually wait for user input (e.g. providing a name, or location, etc.). However, some steps can be executed immediately. One such example is a finishing step, that runs after all other steps have been completed and processes the final result of all the steps that have been executed.

      Returns:
      True if this type of step waits for user input.
    • getStepExecutor

      public StepExecutor getStepExecutor()
      Returns the StepExecutor for the current step.
      Returns:
      The StepExecutor for the current step.
    • skip

      public boolean skip()
      Checks if this step should be skipped based on certain criteria defined by the implementation.
      Returns:
      True if this step should be skipped.
    • getLocalizedMessage

      public Text getLocalizedMessage(IMessageable messageable)
      Returns the localized String that belongs to the current step.
      Returns:
      The localized String that belongs to the current step.
    • appendPropertyText

      public void appendPropertyText(Text text)
      Creates the property information for this step using propertyName and propertyValueSupplier.

      If either the property name or the associated value supplier is null, this method will return an empty optional.

      If updatable is true and the supplied value is not null, the text will contain clickable text to take the user back to this step.

      Parameters:
      text - The text to append the property information to.
    • toString

      public @NonNull String toString()
      Overrides:
      toString in class Object
    • getName

      public String getName()
      The name of this step.
    • getStepPreparation

      public @Nullable Runnable getStepPreparation()
      The action to be taken to prepare this step, if any.
    • isImplicitNextStep

      public boolean isImplicitNextStep()
      Checks if this step should 'automatically' proceed to the next step if the result of running the getStepExecutor() is true.

      See StepExecutor.apply(Object).

      Returns:
      True if the successful execution of this step's executor should cause it to go to the next step automatically.