Class PreValidatedActionExecutor<E>

java.lang.Object
com.atlassian.jira.web.util.PreValidatedActionExecutor<E>
Type Parameters:
E - Type representing validation or execution error.

@ParametersAreNonnullByDefault public class PreValidatedActionExecutor<E> extends Object
Action executor with ability to run validation before executing the action.
Since:
v6.4
  • Constructor Details

    • PreValidatedActionExecutor

      public PreValidatedActionExecutor()
  • Method Details

    • withValidator

      public PreValidatedActionExecutor<E> withValidator(Supplier<io.atlassian.fugue.Option<E>> validator)
    • executeFailOnFirstError

      public <T> io.atlassian.fugue.Either<E,T> executeFailOnFirstError(Supplier<io.atlassian.fugue.Either<E,T>> supplier)
      Runs all validators and executes given supplier if all passed. Immediately returns validation error if any validator fails, without continuing with other validation methods.
      Type Parameters:
      T - Result type
      Parameters:
      supplier - Action to perform when validation passes