Class ElementResultBuilder
- java.lang.Object
-
- de.xima.fc.workflow.processor.logic.validation.ElementResultBuilder
-
- All Implemented Interfaces:
IWorkflowElementValidationResultBuilder
,org.apache.commons.lang3.builder.Builder<IWorkflowElementValidationResult>
public class ElementResultBuilder extends Object implements IWorkflowElementValidationResultBuilder
Default implementation of aIWorkflowElementValidationResultBuilder
.- Since:
- 7.0.0
- Author:
- XIMA MEDIA GmbH
-
-
Constructor Summary
Constructors Constructor Description ElementResultBuilder()
-
Method Summary
-
-
-
Method Detail
-
addException
public ElementResultBuilder addException(Throwable exception)
Description copied from interface:IWorkflowElementValidationResultBuilder
Adds the exceptions to the validation result, seeIWorkflowElementValidationResult.getExceptions()
.- Specified by:
addException
in interfaceIWorkflowElementValidationResultBuilder
- Parameters:
exception
- Exceptions to add that occurred during validation.- Returns:
- This builder instance for chaining.
-
addExceptions
public ElementResultBuilder addExceptions(Iterable<Throwable> exceptions)
Description copied from interface:IWorkflowElementValidationResultBuilder
Adds an exception to the validation result, seeIWorkflowElementValidationResult.getExceptions()
.- Specified by:
addExceptions
in interfaceIWorkflowElementValidationResultBuilder
- Parameters:
exceptions
- Exception to add that occurred during validation.- Returns:
- This builder instance for chaining.
-
addMessage
public IWorkflowElementValidationResultBuilder addMessage(EValidationSeverity severity, String localizedMessage)
Description copied from interface:IWorkflowElementValidationResultBuilder
Adds a message to the validation result.- Specified by:
addMessage
in interfaceIWorkflowElementValidationResultBuilder
- Parameters:
severity
- Severity of the message to add.localizedMessage
- Localized message to add.- Returns:
- This builder instance for chaining.
-
addMessage
public ElementResultBuilder addMessage(IWorkflowValidationMessage message)
Description copied from interface:IWorkflowElementValidationResultBuilder
Adds the given message @Override to the validation result.- Specified by:
addMessage
in interfaceIWorkflowElementValidationResultBuilder
- Parameters:
message
- Message to add.- Returns:
- This builder instance for chaining.
-
addMessages
public ElementResultBuilder addMessages(Iterable<IWorkflowValidationMessage> messages)
Description copied from interface:IWorkflowElementValidationResultBuilder
Adds the given messages to the validation result.- Specified by:
addMessages
in interfaceIWorkflowElementValidationResultBuilder
- Parameters:
messages
- Messages to add.- Returns:
- This builder instance for chaining.
-
append
public IWorkflowElementValidationResultBuilder append(IWorkflowElementValidationResult validationResult)
Description copied from interface:IWorkflowElementValidationResultBuilder
Appends the given validation result to this builder. All messages are added, and this result is marked as invalid when the given result is invalid.- Specified by:
append
in interfaceIWorkflowElementValidationResultBuilder
- Returns:
- This builder instance for chaining.
-
build
public IWorkflowElementValidationResult build()
- Specified by:
build
in interfaceorg.apache.commons.lang3.builder.Builder<IWorkflowElementValidationResult>
-
markInvalid
public ElementResultBuilder markInvalid()
Description copied from interface:IWorkflowElementValidationResultBuilder
Marks the validation result as invalid. By default, the result will be valid.- Specified by:
markInvalid
in interfaceIWorkflowElementValidationResultBuilder
- Returns:
- This builder instance for chaining.
-
setValid
public IWorkflowElementValidationResultBuilder setValid(boolean valid)
Description copied from interface:IWorkflowElementValidationResultBuilder
Marks the validation result as invalid. By default, the result will be valid.- Specified by:
setValid
in interfaceIWorkflowElementValidationResultBuilder
- Parameters:
valid
-true
to mark the result as valid,false
to mark it as invalid.- Returns:
- This builder instance for chaining.
-
exception
public static IWorkflowElementValidationResult exception(Exception e)
- Parameters:
e
- Exception that occurred.- Returns:
- A validation result for when an exception occurred during validation.
-
valid
public static IWorkflowElementValidationResult valid()
- Returns:
- An immutable valid result wihtout any messages.
-
-