Package io.modelcontextprotocol.spec
Record Class McpSchema.ListRootsResult
java.lang.Object
java.lang.Record
io.modelcontextprotocol.spec.McpSchema.ListRootsResult
- Record Components:
roots- An array of Root objects, each representing a root directory or file that the server can operate on.
- Enclosing class:
- McpSchema
The client's response to a roots/list request from the server. This result contains
an array of Root objects, each representing a root directory or file that the
server can operate on.
-
Constructor Summary
ConstructorsConstructorDescriptionListRootsResult(List<McpSchema.Root> roots) Creates an instance of aListRootsResultrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.roots()Returns the value of therootsrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
ListRootsResult
Creates an instance of aListRootsResultrecord class.- Parameters:
roots- the value for therootsrecord component
-
-
Method Details
-
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. All components in this record class are compared withObjects::equals(Object,Object). -
roots
Returns the value of therootsrecord component.- Returns:
- the value of the
rootsrecord component
-