Interface ResourceDescriptor
- All Superinterfaces:
HasMeta,ServerFeature.Descriptor
Descriptor for a static (non-template) resource.
A resource is a named, URI-addressable piece of content such as a file, database record, or API response.
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescription@Nullable AnnotationsOptional annotations for this resource.static ResourceDescriptor.Builderbuilder()Creates a new builder forResourceDescriptor.default voidcheck()@Nullable StringOptional description of this resource.@Nullable StringOptional identifier of the extension that owns this resource.icons()Optional icons for this resource.meta()Optional protocol extension metadata.@Nullable StringmimeType()Optional MIME type of the resource content.name()The resource name, unique within the server.static ResourceDescriptorCreates a resource descriptor with the given fields.static ResourceDescriptorof(String name, String uri, @Nullable String description, @Nullable String mimeType, @Nullable String title, @Nullable Annotations annotations, @Nullable Long size, @Nullable List<Icon> icons) Creates a fully specified resource descriptor.@Nullable Longsize()Optional size of the resource in bytes.@Nullable Stringtitle()Optional human-readable title.uri()The URI that identifies this resource.
-
Method Details
-
name
String name()The resource name, unique within the server.- Specified by:
namein interfaceServerFeature.Descriptor
-
title
@Nullable String title()Optional human-readable title. -
description
@Nullable String description()Optional description of this resource. -
uri
String uri()The URI that identifies this resource. -
mimeType
@Nullable String mimeType()Optional MIME type of the resource content. -
annotations
@Nullable Annotations annotations()Optional annotations for this resource. -
size
@Nullable Long size()Optional size of the resource in bytes. -
icons
Optional icons for this resource. -
extensionId
@Nullable String extensionId()Optional identifier of the extension that owns this resource. -
meta
Optional protocol extension metadata. -
check
@Check default void check() -
builder
Creates a new builder forResourceDescriptor. -
of
static ResourceDescriptor of(String name, String uri, @Nullable String description, @Nullable String mimeType) Creates a resource descriptor with the given fields. -
of
static ResourceDescriptor of(String name, String uri, @Nullable String description, @Nullable String mimeType, @Nullable String title, @Nullable Annotations annotations, @Nullable Long size, @Nullable List<Icon> icons) Creates a fully specified resource descriptor.
-