Package dev.tachyonmcp.api.server.domain
Interface BlobResourceContents
- All Superinterfaces:
HasMeta,ResourceContents
Binary resource contents, encoded as a base64 string.
Used when a resource cannot be represented as text. The uri identifies the
resource, mimeType describes the binary format, and blob carries the
base64-encoded data.
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionblob()Returns the base64-encoded binary content.static BlobResourceContents.Builderbuilder()Creates a new builder for constructingBlobResourceContentsinstances.default voidcheck()Validates that required fields are not blank.meta()Returns the optional metadata map for protocol extensions.@Nullable StringmimeType()Returns the MIME type of the resource content, ornullif unspecified.static BlobResourceContentsCreates binary resource contents with no_meta.static BlobResourceContentsCreates binary resource contents.uri()Returns the resource URI.
-
Method Details
-
uri
Description copied from interface:ResourceContentsReturns the resource URI.- Specified by:
uriin interfaceResourceContents- Returns:
- the resource identifier
-
mimeType
Description copied from interface:ResourceContentsReturns the MIME type of the resource content, ornullif unspecified.- Specified by:
mimeTypein interfaceResourceContents- Returns:
- the MIME type, or
null
-
blob
Returns the base64-encoded binary content.- Returns:
- the blob data as a base64 string
-
meta
Description copied from interface:HasMetaReturns the optional metadata map for protocol extensions. -
check
@Check default void check()Validates that required fields are not blank.- Throws:
IllegalArgumentException- ifuriorblobis blank
-
of
Creates binary resource contents with no_meta.- Parameters:
uri- the resource URIblob- the base64-encoded binary contentmimeType- the content's MIME type, ornullif unspecified- Returns:
- a new blob resource contents
-
of
static BlobResourceContents of(String uri, String blob, @Nullable String mimeType, @Nullable Map<String, Object> meta) Creates binary resource contents.- Parameters:
uri- the resource URIblob- the base64-encoded binary contentmimeType- the content's MIME type, ornullif unspecifiedmeta- the_metaentries, ornullif none- Returns:
- a new blob resource contents
-
builder
Creates a new builder for constructingBlobResourceContentsinstances.- Returns:
- a new builder
-