Package ai.pipestream.common.validation
Class ValidationResultFactory
java.lang.Object
ai.pipestream.common.validation.ValidationResultFactory
Factory for creating ValidationResult instances.
-
Method Summary
Modifier and TypeMethodDescriptionstatic ValidationResultCreates an invalid result with a single error.static ValidationResultCreates an invalid result with the given errors.static ValidationResultCreates an invalid result with errors and warnings.static ValidationResultsuccess()Creates a valid result with no errors or warnings.static ValidationResultsuccessWithWarnings(List<String> warnings) Creates a valid result with warnings.
-
Method Details
-
success
Creates a valid result with no errors or warnings.- Returns:
- a valid ValidationResult with no errors or warnings
-
successWithWarnings
Creates a valid result with warnings.- Parameters:
warnings- list of warning messages- Returns:
- a valid ValidationResult with the specified warnings
-
failure
Creates an invalid result with the given errors.- Parameters:
errors- list of error messages- Returns:
- an invalid ValidationResult with the specified errors
-
failure
Creates an invalid result with a single error.- Parameters:
error- the error message- Returns:
- an invalid ValidationResult with the specified error
-
failure
Creates an invalid result with errors and warnings.- Parameters:
errors- list of error messageswarnings- list of warning messages- Returns:
- an invalid ValidationResult with the specified errors and warnings
-