Record Class ValidationResult
java.lang.Object
java.lang.Record
ai.pipestream.registration.handlers.ValidationResult
- Record Components:
valid-trueif validation passed,falseotherwisereasons- the list of failure reasons; empty whenvalidistrue
-
Constructor Summary
ConstructorsConstructorDescriptionValidationResult(boolean valid, List<String> reasons) Creates an instance of aValidationResultrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.static ValidationResultCreates a failed result carrying the given failure reasons.final inthashCode()Returns a hash code value for this object.static ValidationResultok()Creates a successful result with no failure reasons.reasons()Returns the value of thereasonsrecord component.Joins the failure reasons into a single semicolon-separated string.final StringtoString()Returns a string representation of this record class.booleanvalid()Returns the value of thevalidrecord component.
-
Constructor Details
-
ValidationResult
-
-
Method Details
-
ok
Creates a successful result with no failure reasons.- Returns:
- a valid result with an empty reason list
-
failed
Creates a failed result carrying the given failure reasons.- Parameters:
reasons- the failure reasons to report- Returns:
- an invalid result holding a defensive copy of
reasons
-
reasonsAsString
Joins the failure reasons into a single semicolon-separated string.- Returns:
- the reasons joined with
"; ", or an empty string when there are none
-
toString
-
hashCode
-
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 thecomparemethod from their corresponding wrapper classes. -
valid
-
reasons
-