Class ValidationResult


  • public class ValidationResult
    extends java.lang.Object
    The results of a validator
    • Field Detail

      • VALID_NO_ERRORS

        public static final ValidationResult VALID_NO_ERRORS
        Only one of these really needed.
    • Constructor Detail

      • ValidationResult

        public ValidationResult()
        Default constructor
    • Method Detail

      • addMessage

        public void addMessage​(@NonNull
                               @NonNull ValidationResult.ErrorCode code,
                               java.lang.String offendingPart)
        Add an error message
        Parameters:
        code - an ErrorCode
        offendingPart - something to indicate what contains the error. Can be null.
      • isValid

        public boolean isValid()
        The result of the validation.
        Returns:
        false if there are any error messages
      • merge

        public void merge​(@NonNull
                          @NonNull ValidationResult other)
        Merge errors from another validator
        Parameters:
        other - a ValidationResult