Record Class McpResourceContents
java.lang.Object
java.lang.Record
com.soklet.McpResourceContents
@Immutable
public record McpResourceContents(@NonNull String uri, @NonNull String mimeType, @Nullable String text, @Nullable String blobBase64)
extends Record
Immutable resource-read result payload.
- Author:
- Mark Allen
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theblobBase64record component.final booleanIndicates whether some other object is "equal to" this one.static @NonNull McpResourceContentsCreates a blob-backed resource-contents payload.static @NonNull McpResourceContentsCreates a text-backed resource-contents payload.final inthashCode()Returns a hash code value for this object.mimeType()Returns the value of themimeTyperecord component.text()Returns the value of thetextrecord component.final StringtoString()Returns a string representation of this record class.uri()Returns the value of theurirecord component.
-
Constructor Details
-
McpResourceContents
public McpResourceContents(@NonNull String uri, @NonNull String mimeType, @Nullable String text, @Nullable String blobBase64) Creates an instance of aMcpResourceContentsrecord class.- Parameters:
uri- the value for theurirecord componentmimeType- the value for themimeTyperecord componenttext- the value for thetextrecord componentblobBase64- the value for theblobBase64record component
-
-
Method Details
-
fromText
public static @NonNull McpResourceContents fromText(@NonNull String uri, @NonNull String text, @NonNull String mimeType) Creates a text-backed resource-contents payload.- Parameters:
uri- the resource URItext- the text payloadmimeType- the MIME type- Returns:
- a text-backed resource contents value
-
fromBlob
public static @NonNull McpResourceContents fromBlob(@NonNull String uri, @NonNull String blobBase64, @NonNull String mimeType) Creates a blob-backed resource-contents payload.- Parameters:
uri- the resource URIblobBase64- the base64-encoded blob payloadmimeType- the MIME type- Returns:
- a blob-backed resource contents value
-
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
-
mimeType
-
text
-
blobBase64
Returns the value of theblobBase64record component.- Returns:
- the value of the
blobBase64record component
-