Class ValidationResult


  • public class ValidationResult
    extends Object
    Contains the results of validating rename mappings.
    • Constructor Detail

      • ValidationResult

        public ValidationResult()
    • Method Detail

      • addError

        public void addError​(String message)
        Records an error, which makes the result invalid.
        Parameters:
        message - error text
      • addWarning

        public void addWarning​(String message)
        Records a warning, which leaves the result valid.
        Parameters:
        message - warning text
      • isValid

        public boolean isValid()
        Returns:
        true if no error was recorded
      • hasErrors

        public boolean hasErrors()
        Returns:
        true if at least one error was recorded
      • hasWarnings

        public boolean hasWarnings()
        Returns:
        true if at least one warning was recorded
      • getErrors

        public List<String> getErrors()
        Returns:
        an unmodifiable view of the error messages
      • getWarnings

        public List<String> getWarnings()
        Returns:
        an unmodifiable view of the warning messages
      • getErrorCount

        public int getErrorCount()
        Returns:
        the number of recorded errors
      • getWarningCount

        public int getWarningCount()
        Returns:
        the number of recorded warnings
      • merge

        public void merge​(ValidationResult other)
        Appends another result's errors and warnings to this one.
        Parameters:
        other - result to absorb
      • getReport

        public String getReport()
        Renders every error and warning as an indented, sectioned listing.
        Returns:
        the report, or a "no errors or warnings" line when both lists are empty