Closed Paul2708 closed 5 years ago
A notation that declares an argument as optional.
Implementation idea The notation can be realised by @Optional or Optional<Type> or even both?
@Optional
Optional<Type>
Screenshots or code Annotation:
@Command(name = "test") public void test(Player sender, @Optional String name) { if (CommandArgument.isPresent(name)) { // Argument is present } }
Optional:
@Command(name = "test") public void test(Player sender, Optional<String> name) { if (name.isPresent()) { // Argument is present } }
Description
A notation that declares an argument as optional.
Usage
Implementation idea The notation can be realised by
@Optional
orOptional<Type>
or even both?Screenshots or code Annotation:
Optional: