Class McpSkillPage.Builder
java.lang.Object
com.soklet.McpSkillPage.Builder
- Enclosing class:
McpSkillPage
Single-threaded builder for an immutable Skills page.
- Author:
- Mark Allen
-
Method Summary
Modifier and TypeMethodDescriptionbuild()Builds one complete immutable page.cacheTimeToLiveOverride(@NonNull Duration cacheTimeToLiveOverride) Overrides default freshness without changing cache scope or bypassing localization and security clamps.metadata(@NonNull McpJsonObject metadata) Sets result-level protocol extension metadata, not skill frontmatter.nextCursor(@NonNull String nextCursor) Supplies an application-owned opaque continuation cursor.skillRegistrations(@Nullable List<@NonNull McpSkillRegistration> skillRegistrations) Replaces registration references in supplied order.
-
Method Details
-
skillRegistrations
public @NonNull McpSkillPage.Builder skillRegistrations(@Nullable List<@NonNull McpSkillRegistration> skillRegistrations) Replaces registration references in supplied order. Null or empty clears the property. The complete list is snapshotted before replacing its prior value. Runtime validation requires exact configured registration instances, without duplicate URIs, and enforces current access and page-phase rules.- Parameters:
skillRegistrations- registration references, or null to clear- Returns:
- this builder
- Throws:
NullPointerException- if a list element is null
-
metadata
Sets result-level protocol extension metadata, not skill frontmatter.- Parameters:
metadata- immutable result-level protocol extension metadata- Returns:
- this builder
- Throws:
NullPointerException- if metadata is null
-
nextCursor
Supplies an application-owned opaque continuation cursor. Empty strings remain present values; no trimming or normalization occurs.- Parameters:
nextCursor- next cursor- Returns:
- this builder
- Throws:
IllegalArgumentException- if the cursor contains malformed UTF-16NullPointerException- if the cursor is null
-
cacheTimeToLiveOverride
public @NonNull McpSkillPage.Builder cacheTimeToLiveOverride(@NonNull Duration cacheTimeToLiveOverride) Overrides default freshness without changing cache scope or bypassing localization and security clamps.- Parameters:
cacheTimeToLiveOverride- nonnegative whole-millisecond duration- Returns:
- this builder
- Throws:
NullPointerException- if the duration is nullIllegalArgumentException- if negative, sub-millisecond, or too large for a signed 64-bit millisecond value
-
build
Builds one complete immutable page.- Returns:
- immutable Skills page
- Throws:
IllegalStateException- if the page contains more than 32 registrationsIllegalArgumentException- if application metadata uses a reserved framework key
-