Package ai.pipestream.common.validation
Record Class DefaultValidationResult
java.lang.Object
java.lang.Record
ai.pipestream.common.validation.DefaultValidationResult
- Record Components:
valid- whether the validation passederrors- list of error messages if validation failedwarnings- list of warning messages
- All Implemented Interfaces:
ai.pipestream.api.validation.ValidationResult
public record DefaultValidationResult(boolean valid, List<String> errors, List<String> warnings)
extends Record
implements ai.pipestream.api.validation.ValidationResult
Result of pipeline configuration validation.
Contains validation status, errors, and warnings.
-
Constructor Summary
ConstructorsConstructorDescriptionDefaultValidationResult(boolean valid, List<String> errors, List<String> warnings) Ensures immutability of lists -
Method Summary
Modifier and TypeMethodDescriptionai.pipestream.api.validation.ValidationResultcombine(ai.pipestream.api.validation.ValidationResult other) Combines this result with another, taking the most restrictive validity.final booleanIndicates whether some other object is "equal to" this one.errors()Returns the value of theerrorsrecord component.static ai.pipestream.api.validation.ValidationResultCreates an invalid result with a single error.static ai.pipestream.api.validation.ValidationResultCreates an invalid result with the given errors.static ai.pipestream.api.validation.ValidationResultCreates an invalid result with errors and warnings.booleanReturns true if there are any errors.final inthashCode()Returns a hash code value for this object.booleanReturns true if there are any issues (errors or warnings).booleanReturns true if there are any warnings.static ai.pipestream.api.validation.ValidationResultsuccess()Creates a valid result with no errors or warnings.static ai.pipestream.api.validation.ValidationResultsuccessWithWarnings(List<String> warnings) Creates a valid result with warnings.final StringtoString()Returns a string representation of this record class.booleanvalid()Returns the value of thevalidrecord component.warnings()Returns the value of thewarningsrecord component.
-
Constructor Details
-
DefaultValidationResult
Ensures immutability of lists
-
-
Method Details
-
success
public static ai.pipestream.api.validation.ValidationResult success()Creates a valid result with no errors or warnings.- Returns:
- a valid ValidationResult with no errors or warnings
-
successWithWarnings
public static ai.pipestream.api.validation.ValidationResult successWithWarnings(List<String> warnings) 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
public static ai.pipestream.api.validation.ValidationResult failure(List<String> errors, List<String> warnings) 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
-
combine
public ai.pipestream.api.validation.ValidationResult combine(ai.pipestream.api.validation.ValidationResult other) Combines this result with another, taking the most restrictive validity. Accumulates all errors and warnings from both results.- Specified by:
combinein interfaceai.pipestream.api.validation.ValidationResult
-
hasIssues
public boolean hasIssues()Returns true if there are any issues (errors or warnings).- Specified by:
hasIssuesin interfaceai.pipestream.api.validation.ValidationResult
-
hasErrors
public boolean hasErrors()Returns true if there are any errors.- Specified by:
hasErrorsin interfaceai.pipestream.api.validation.ValidationResult
-
hasWarnings
public boolean hasWarnings()Returns true if there are any warnings.- Specified by:
hasWarningsin interfaceai.pipestream.api.validation.ValidationResult
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
valid
public boolean valid()Returns the value of thevalidrecord component.- Specified by:
validin interfaceai.pipestream.api.validation.ValidationResult- Returns:
- the value of the
validrecord component
-
errors
Returns the value of theerrorsrecord component.- Specified by:
errorsin interfaceai.pipestream.api.validation.ValidationResult- Returns:
- the value of the
errorsrecord component
-
warnings
Returns the value of thewarningsrecord component.- Specified by:
warningsin interfaceai.pipestream.api.validation.ValidationResult- Returns:
- the value of the
warningsrecord component
-