Interface ResourceDescriptor

All Superinterfaces:
HasMeta, ServerFeature.Descriptor

@Immutable public interface ResourceDescriptor extends ServerFeature.Descriptor, HasMeta
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.

  • Method Details

    • name

      String name()
      The resource name, unique within the server.
      Specified by:
      name in interface ServerFeature.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

      @Nullable List<Icon> icons()
      Optional icons for this resource.
    • extensionId

      @Nullable String extensionId()
      Optional identifier of the extension that owns this resource.
    • meta

      @Nullable Map<String,Object> meta()
      Optional protocol extension metadata.
      Specified by:
      meta in interface HasMeta
      Returns:
      the metadata map, or null if none
    • check

      @Check default void check()
    • builder

      static ResourceDescriptor.Builder builder()
      Creates a new builder for ResourceDescriptor.
    • 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.