🎨 Change (improve) command context semantics
This commit is contained in:
parent
ee59066733
commit
9d47a7c82d
8 changed files with 33 additions and 30 deletions
|
|
@ -62,9 +62,9 @@ class MethodCommandExecutionHandler<C> implements CommandExecutionHandler<C> {
|
|||
final Argument argument = parameter.getAnnotation(Argument.class);
|
||||
final CommandArgument<C, ?> commandArgument = this.commandArguments.get(argument.value());
|
||||
if (commandArgument.isRequired()) {
|
||||
arguments.add(commandContext.getRequired(argument.value()));
|
||||
arguments.add(commandContext.get(argument.value()));
|
||||
} else {
|
||||
final Object optional = commandContext.get(argument.value()).orElse(null);
|
||||
final Object optional = commandContext.getOptional(argument.value()).orElse(null);
|
||||
arguments.add(optional);
|
||||
}
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue