@ParametersAreNonnullByDefault public class

PreValidatedActionExecutor

extends Object
java.lang.Object
   ↳ com.atlassian.jira.web.util.PreValidatedActionExecutor<E>

Class Overview

Action executor with ability to run validation before executing the action.

Summary

Public Constructors
PreValidatedActionExecutor()
Public Methods
<T> Either<E, T> executeFailOnFirstError(Supplier<Either<E, T>> supplier)
Runs all validators and executes given supplier if all passed.
PreValidatedActionExecutor<E> withValidator(Supplier<Option<E>> validator)
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public PreValidatedActionExecutor ()

Public Methods

public Either<E, T> executeFailOnFirstError (Supplier<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.

Parameters
supplier Action to perform when validation passes

public PreValidatedActionExecutor<E> withValidator (Supplier<Option<E>> validator)