Allow for optionals in annotated methods
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 548
- Forks
- 60
- PR merge metrics
- No merged PRs in 30d
Description
We should allow for optionals to be used in annotated arguments in place of nullable parameters. Example:
@Command("command [component]")
public void someCommand(Optional<SomeType> component) {
// ...
}
We should be able to infer the type of the optional without any issues. We will need to consider the mapping between components and optionals both when parsing & constructing the command tree, but also when mapping the parsed values to the method parameters.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing the code that parses annotated arguments and constructs the command tree, then follow the mapping from parsed values to method parameters. Done means an annotated Optional argument can infer SomeType and correctly map both present and absent command components.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- cli
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100