Record Class JsonSchemaValidator.ValidationResult
java.lang.Object
java.lang.Record
cloud.opencode.base.json.schema.JsonSchemaValidator.ValidationResult
- Enclosing class:
JsonSchemaValidator
public static record JsonSchemaValidator.ValidationResult(boolean valid, List<JsonSchemaException.ValidationError> errors)
extends Record
Validation result record.
验证结果记录。
- Since:
- JDK 25, opencode-base-json V1.0.0
- Author:
- Leon Soo www.LeonSoo.com
-
Constructor Summary
ConstructorsConstructorDescriptionValidationResult(boolean valid, List<JsonSchemaException.ValidationError> errors) Creates an instance of aValidationResultrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.errors()Returns the value of theerrorsrecord component.final inthashCode()Returns a hash code value for this object.booleanisValid()success()final StringtoString()Returns a string representation of this record class.booleanvalid()Returns the value of thevalidrecord component.
-
Constructor Details
-
ValidationResult
Creates an instance of aValidationResultrecord class.- Parameters:
valid- the value for thevalidrecord componenterrors- the value for theerrorsrecord component
-
-
Method Details
-
success
-
failure
public static JsonSchemaValidator.ValidationResult failure(List<JsonSchemaException.ValidationError> errors) -
failure
public static JsonSchemaValidator.ValidationResult failure(JsonSchemaException.ValidationError error) -
isValid
public boolean isValid() -
getErrors
-
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
public boolean valid()Returns the value of thevalidrecord component.- Returns:
- the value of the
validrecord component
-
errors
Returns the value of theerrorsrecord component.- Returns:
- the value of the
errorsrecord component
-