🎨 Change (improve) command context semantics

This commit is contained in:
Alexander Söderberg 2020-10-01 13:24:15 +02:00
parent ee59066733
commit 9d47a7c82d
No known key found for this signature in database
GPG key ID: C0207FF7EA146678
8 changed files with 33 additions and 30 deletions

View file

@ -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 {