Class Statement<T>


  • public final class Statement<T>
    extends Object
    • Constructor Detail

      • Statement

        public Statement()
    • Method Detail

      • and

        public T and()
        Allows for a and condition to apply to validations.
        Returns:
        the value of type T associated with this statement
      • or

        public T or()
        Defines an "or" conditional in the validation chain.
        Returns:
        the value of type T associated 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