Record Class McpListedResource
java.lang.Object
java.lang.Record
com.soklet.McpListedResource
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of thedescriptionrecord component.final booleanIndicates whether some other object is "equal to" this one.static @NonNull McpListedResourceCreates a minimal resource-list entry without optional metadata.final inthashCode()Returns a hash code value for this object.mimeType()Returns the value of themimeTyperecord component.name()Returns the value of thenamerecord component.Returns the value of thesizeBytesrecord component.title()Returns the value of thetitlerecord component.final StringtoString()Returns a string representation of this record class.uri()Returns the value of theurirecord component.withDescription(@NonNull String description) Returns a copy of this resource entry with a description.withSizeBytes(@NonNull Long sizeBytes) Returns a copy of this resource entry with a size metadata value.Returns a copy of this resource entry with a title.
-
Constructor Details
-
McpListedResource
public McpListedResource(@NonNull String uri, @NonNull String name, @NonNull String mimeType, @Nullable String title, @Nullable String description, @Nullable Long sizeBytes) Creates an instance of aMcpListedResourcerecord class.- Parameters:
uri- the value for theurirecord componentname- the value for thenamerecord componentmimeType- the value for themimeTyperecord componenttitle- the value for thetitlerecord componentdescription- the value for thedescriptionrecord componentsizeBytes- the value for thesizeBytesrecord component
-
-
Method Details
-
fromComponents
public static @NonNull McpListedResource fromComponents(@NonNull String uri, @NonNull String name, @NonNull String mimeType) Creates a minimal resource-list entry without optional metadata.- Parameters:
uri- the resource URIname- the resource namemimeType- the resource MIME type- Returns:
- a minimal listed-resource entry
-
withTitle
Returns a copy of this resource entry with a title.- Parameters:
title- the title to apply- Returns:
- a new resource entry with the given title
-
withDescription
Returns a copy of this resource entry with a description.- Parameters:
description- the description to apply- Returns:
- a new resource entry with the given description
-
withSizeBytes
Returns a copy of this resource entry with a size metadata value.- Parameters:
sizeBytes- the non-negative size in bytes- Returns:
- a new resource entry with the given size
-
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). -
uri
-
name
-
mimeType
-
title
-
description
Returns the value of thedescriptionrecord component.- Returns:
- the value of the
descriptionrecord component
-
sizeBytes
-