Class: ValidationResult

ValidationResult(isValid, errors)

Result container for metadata validation operations. Tracks validation state and collects validation errors for reporting. Provides methods to check success state and combine multiple validation results.

Constructor

new ValidationResult(isValid, errors)

Create a new ValidationResult.
Parameters:
Name Type Default Description
isValid boolean true Whether validation passed
errors Array.<string> Array of validation error messages
Source:

Methods

addError(message)

Add an error message to this result.
Parameters:
Name Type Description
message string Error message to add
Source:

combine(other) → {ValidationResult}

Combine this result with another validation result.
Parameters:
Name Type Description
other ValidationResult Other result to combine
Source:
Returns:
Combined result
Type
ValidationResult

getErrorSummary() → {string}

Get formatted error summary.
Source:
Returns:
Formatted error messages joined by newlines
Type
string

getErrors() → {Array.<string>}

Get all validation error messages.
Source:
Returns:
Array of error messages
Type
Array.<string>

hasErrors() → {boolean}

Check if validation failed.
Source:
Returns:
True if validation failed
Type
boolean

isValid() → {boolean}

Check if validation was successful.
Source:
Returns:
True if validation passed
Type
boolean

(static) failure(errors) → {ValidationResult}

Create a failed validation result.
Parameters:
Name Type Description
errors Array.<string> Array of error messages
Source:
Returns:
Failure result
Type
ValidationResult

(static) success() → {ValidationResult}

Create a successful validation result.
Source:
Returns:
Success result
Type
ValidationResult