Class ElementResultBuilder
java.lang.Object
de.xima.fc.workflow.processor.logic.validation.ElementResultBuilder
- All Implemented Interfaces:
IWorkflowElementValidationResultBuilder
,org.apache.commons.lang3.builder.Builder<IWorkflowElementValidationResult>
Default implementation of a
IWorkflowElementValidationResultBuilder
.- Since:
- 7.0.0
- Author:
- XIMA MEDIA GmbH
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddException
(Throwable exception) Adds the exceptions to the validation result, seeIWorkflowElementValidationResult.getExceptions()
.addExceptions
(Iterable<Throwable> exceptions) Adds an exception to the validation result, seeIWorkflowElementValidationResult.getExceptions()
.addMessage
(IWorkflowValidationMessage message) Adds the given message @Override to the validation result.addMessage
(EValidationSeverity severity, String localizedMessage) Adds a message to the validation result.addMessages
(Iterable<IWorkflowValidationMessage> messages) Adds the given messages to the validation result.append
(IWorkflowElementValidationResult validationResult) Appends the given validation result to this builder.build()
Marks the validation result as invalid.setValid
(boolean valid) Marks the validation result as invalid.valid()
-
Constructor Details
-
ElementResultBuilder
public ElementResultBuilder()
-
-
Method Details
-
addException
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
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
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
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
- Parameters:
validationResult
- Validation result to add to the list of results.- Returns:
- This builder instance for chaining.
-
build
- Specified by:
build
in interfaceorg.apache.commons.lang3.builder.Builder<IWorkflowElementValidationResult>
-
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
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
- Parameters:
e
- Exception that occurred.- Returns:
- A validation result for when an exception occurred during validation.
-
valid
- Returns:
- An immutable valid result wihtout any messages.
-