Class Step.Factory
- Enclosing class:
Step
Step objects.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceNested factory used to create newStep.Factoryinstances. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionCreates the newStepobject using the provided values.implicitNextStep(boolean implicitNextStep) messageKey(String messageKey) Sets the key of the localized message for this step.propertyName(@Nullable String name) Sets the name of the property to be used when reporting the result of this step to the user.propertyValueSupplier(@Nullable Supplier<?> propertyValueSupplier) Sets the supplier for the value of the property that was modified by this step when reporting the result of this step to the user.skipCondition(Supplier<Boolean> skipCondition) Sets the implementation ofStep.skip().stepExecutor(StepExecutor stepExecutor) stepPreparation(Runnable prepareStep) textSupplier(Function<Text, Text> textSupplier) Sets the supplier for the Text object that is used to provide instructions for this step.updatable(boolean updatable) Sets whether this step can be updated after it has been set.waitForUserInput(boolean waitForUserInput)
-
Constructor Details
-
Factory
@VisibleForTesting @AssistedInject @Deprecated public Factory(ILocalizer localizer, @Assisted String name) Deprecated.Prefer instantiation usingStep.Factory.IFactoryinstead.
-
-
Method Details
-
implicitNextStep
- Returns:
- The current Factory.
-
stepPreparation
- Returns:
- The current Factory.
-
stepExecutor
- Returns:
- The current Factory.
-
messageKey
Sets the key of the localized message for this step.This is a shortcut for setting a text supplier with a string localized via the localizer.
- Returns:
- The current Factory.
-
textSupplier
Sets the supplier for the Text object that is used to provide instructions for this step.The input of the function is always a new and empty
Textobject.- Parameters:
textSupplier- The function that supplies an instruction Text.- Returns:
- The current Factory.
-
skipCondition
Sets the implementation ofStep.skip().This can be used to disable certain steps based on arbitrary conditions (e.g. configuration settings).
- Returns:
- The current Factory.
-
waitForUserInput
- Returns:
- The current Factory.
-
propertyName
Sets the name of the property to be used when reporting the result of this step to the user.The value that will be reported is retrieved using the supplier set via
propertyValueSupplier(Supplier).Set to null to disable reporting this step.
- Parameters:
name- The localized name.- Returns:
- The current Factory.
-
propertyValueSupplier
Sets the supplier for the value of the property that was modified by this step when reporting the result of this step to the user.The name of the value is retrieved using
propertyName(String).Set to null to disable reporting this step.
- Parameters:
propertyValueSupplier- The supplier for the field.- Returns:
- The current Factory.
-
updatable
Sets whether this step can be updated after it has been set.This is used for the review step, where the user can review the selected settings and revisit those that they would like to change.
This setting has no effect when either
propertyValueSupplier(Supplier)orpropertyName(String)is null.- Parameters:
updatable- True if this step can be updated.- Returns:
- The current Factory.
-
construct
Creates the newStepobject using the provided values.- Returns:
- The new Step object.
- Throws:
InstantiationException- When this method is called but neither the step executor nor the message key is set.
-
Step.Factory.IFactoryinstead.