[Java] Add Param<T> public API type for lambda-defined tools#1845
Conversation
Your branch is up to date with 'upstream/edburns/1810-java-tool-ergonomics-tool-as-lambda'. Changes to be committed: (use "git restore --staged <file>..." to unstage) modified: 1810-java-tool-ergonomics-tool-as-lambda-remove-before-merge/1810-ignorance-reduction-for-implementation-plan.md modified: 1810-java-tool-ergonomics-tool-as-lambda-remove-before-merge/20260628-prompts.md new file: 1810-java-tool-ergonomics-tool-as-lambda-remove-before-merge/20260629-prompts.md Signed-off-by: Ed Burns <edburns@microsoft.com>
…Phase 03. modified: 1810-java-tool-ergonomics-tool-as-lambda-remove-before-merge/1810-ignorance-reduction-for-implementation-plan.md modified: 1810-java-tool-ergonomics-tool-as-lambda-remove-before-merge/20260629-prompts.md Signed-off-by: Ed Burns <edburns@microsoft.com>
modified: 1810-java-tool-ergonomics-tool-as-lambda-remove-before-merge/1810-ignorance-reduction-for-implementation-plan.md - Check off the things already done. modified: 1810-java-tool-ergonomics-tool-as-lambda-remove-before-merge/20260629-prompts.md - GUTDODP
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Introduce `com.github.copilot.tool.Param<T>` — an immutable, fluent runtime parameter metadata class for inline/lambda tool definitions. Validation behavior: - Rejects blank name/description - Rejects required=true with non-empty defaultValue - Validates default values against declared Class<T> Includes comprehensive unit tests (ParamTest, 24 cases). Updates Phase 4.1 checkbox in the implementation plan.
Param<T> public API type for lambda-defined tools
This comment has been minimized.
This comment has been minimized.
fb4049f to
4b9c143
Compare
…copilot/edburns1810-java-tool-ergonomics-tool-as-lambda
SDK Consistency Review ✅Reviewed cross-SDK consistency for the Finding: No consistency issues — Java-specific gap fillThe
Java lacks any of the other languages' built-in mechanisms for attaching per-parameter metadata inline (no Zod, no Pydantic, no struct tags, no C# attributes for a lambda/method-reference style call). The API shape mirrors existing
|
c9faaf9
into
edburns/1810-java-tool-ergonomics-tool-as-lambda
Phase 4.1 of #1810: introduces the runtime parameter metadata class needed by the upcoming
ToolDefinition.from(...)lambda overloads.Changes
Param<T>(com.github.copilot.tool) — immutable, fluent parameter descriptor with construction-time validation:name/descriptionrequired=truecombined with a non-emptydefaultValuedefaultValueagainst declaredClass<T>(String, numeric primitives/boxed, Boolean, enums; unsupported types throw)ParamTest— 27 unit tests covering factory methods, fluent mutators, all validation rules, and equality semanticsUsage
No changes to
module-info.javaneeded —com.github.copilot.toolis already exported.