Package dev.tachyonmcp.api.server.domain
Interface Icon
@Immutable
public interface Icon
An icon entry for a tool or resource, pointing to an image resource.
All fields except src are optional. Sizes use the conventional format
(e.g. "16x16", "32x32"), and theme distinguishes light
vs. dark variants.
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionstatic Icon.Builderbuilder()Creates a new builder forIcon.default voidcheck()Validates that the icon source is not blank.@Nullable StringmimeType()MIME type of the icon image (e.g.static IconCreates an icon with the given values.sizes()Conventional size labels (e.g.src()Image URL or data URI for this icon.@Nullable Stringtheme()Theme variant this icon is designed for.
-
Method Details
-
src
Image URL or data URI for this icon.- Returns:
- the icon source, never blank
-
mimeType
@Nullable String mimeType()MIME type of the icon image (e.g."image/png").- Returns:
- the MIME type, or
nullwhen unknown
-
sizes
Conventional size labels (e.g.["16x16", "32x32"]).- Returns:
- the size labels, or
nullwhen unspecified
-
theme
@Nullable String theme()Theme variant this icon is designed for.- Returns:
"light","dark", ornullwhen universal
-
check
@Check default void check()Validates that the icon source is not blank.- Throws:
IllegalArgumentException- ifsrcis blank
-
builder
Creates a new builder forIcon.- Returns:
- a new builder
-
of
static Icon of(String src, @Nullable String mimeType, @Nullable List<String> sizes, @Nullable String theme) Creates an icon with the given values.- Parameters:
src- image URL or data URImimeType- image MIME type, ornullsizes- conventional size labels, ornulltheme- theme variant, ornull- Returns:
- the new icon
-