Package io.modelcontextprotocol.spec
Record Class JsonSchemaValidator.ValidationResponse
java.lang.Object
java.lang.Record
io.modelcontextprotocol.spec.JsonSchemaValidator.ValidationResponse
- Record Components:
valid- Indicates whether the validation was successful.errorMessage- An error message if the validation failed, otherwise null.jsonStructuredOutput- The text structured content in JSON format if the validation was successful, otherwise null.
- Enclosing interface:
- JsonSchemaValidator
public static record JsonSchemaValidator.ValidationResponse(boolean valid, String errorMessage, String jsonStructuredOutput)
extends Record
Represents the result of a validation operation.
-
Constructor Summary
ConstructorsConstructorDescriptionValidationResponse(boolean valid, String errorMessage, String jsonStructuredOutput) Creates an instance of aValidationResponserecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.Returns the value of theerrorMessagerecord component.final inthashCode()Returns a hash code value for this object.Returns the value of thejsonStructuredOutputrecord component.final StringtoString()Returns a string representation of this record class.booleanvalid()Returns the value of thevalidrecord component.
-
Constructor Details
-
ValidationResponse
Creates an instance of aValidationResponserecord class.- Parameters:
valid- the value for thevalidrecord componenterrorMessage- the value for theerrorMessagerecord componentjsonStructuredOutput- the value for thejsonStructuredOutputrecord component
-
-
Method Details
-
asValid
-
asInvalid
-
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.- Returns:
- the value of the
validrecord component
-
errorMessage
Returns the value of theerrorMessagerecord component.- Returns:
- the value of the
errorMessagerecord component
-
jsonStructuredOutput
Returns the value of thejsonStructuredOutputrecord component.- Returns:
- the value of the
jsonStructuredOutputrecord component
-