Record Class McpTool
java.lang.Object
java.lang.Record
org.infinispan.rest.resources.mcp.McpTool
- All Implemented Interfaces:
JsonSerialization
public record McpTool(String name, String description, McpInputSchema inputSchema, BiFunction<RestRequest, Json, CompletionStage<Json>> callback)
extends Record
implements JsonSerialization
-
Constructor Summary
ConstructorsConstructorDescriptionMcpTool(String name, String description, McpInputSchema inputSchema, BiFunction<RestRequest, Json, CompletionStage<Json>> callback) Creates an instance of aMcpToolrecord class. -
Method Summary
Modifier and TypeMethodDescriptioncallback()Returns the value of thecallbackrecord component.Returns the value of thedescriptionrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.Returns the value of theinputSchemarecord component.name()Returns the value of thenamerecord component.toJson()final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
McpTool
public McpTool(String name, String description, McpInputSchema inputSchema, BiFunction<RestRequest, Json, CompletionStage<Json>> callback) Creates an instance of aMcpToolrecord class.- Parameters:
name- the value for thenamerecord componentdescription- the value for thedescriptionrecord componentinputSchema- the value for theinputSchemarecord componentcallback- the value for thecallbackrecord component
-
-
Method Details
-
toJson
- Specified by:
toJsonin interfaceJsonSerialization
-
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. All components in this record class are compared withObjects::equals(Object,Object). -
name
Returns the value of thenamerecord component.- Returns:
- the value of the
namerecord component
-
description
Returns the value of thedescriptionrecord component.- Returns:
- the value of the
descriptionrecord component
-
inputSchema
Returns the value of theinputSchemarecord component.- Returns:
- the value of the
inputSchemarecord component
-
callback
Returns the value of thecallbackrecord component.- Returns:
- the value of the
callbackrecord component
-