Package nl.zerofiftyit.mdepunit.dsl
Class Statement<T>
- java.lang.Object
-
- nl.zerofiftyit.mdepunit.dsl.Statement<T>
-
public final class Statement<T> extends Object
-
-
Constructor Summary
Constructors Constructor Description Statement()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Tand()Allows for a and condition to apply to validations.Tor()Defines an "or" conditional in the validation chain.voidvalidate()Validates the current instance by checking for any accumulated error messages.voidvalidate(String reason)Validates the current instance with a specific reason for validation.
-
-
-
Method Detail
-
and
public T and()
Allows for a and condition to apply to validations.- Returns:
- the value of type
Tassociated with this statement
-
or
public T or()
Defines an "or" conditional in the validation chain.- Returns:
- the value of type
Tassociated with this statement
-
validate
public void validate()
Validates the current instance by checking for any accumulated error messages. If error messages are present, invokes the error display mechanism.This method is typically used to ensure the integrity of the instance based on predefined validation rules. It throws an exception with details about the validation errors if any are found.
- Throws:
PomValidationException- if validation fails due to the presence of error messages.
-
validate
public void validate(String reason)
Validates the current instance with a specific reason for validation. This method prepends the provided reason to any error messages before performing the validation check.- Parameters:
reason- the reason for validation, which will be included in any error message- Throws:
PomValidationException- if validation fails due to the presence of error messages
-
-