🎨 Remove StaticArgument#Optional

Not needed with the introduction of the flag system. This closes #15.
This commit is contained in:
Alexander Söderberg 2020-10-03 22:44:36 +02:00
parent a2670722e7
commit eb07fd1a2f
No known key found for this signature in database
GPG key ID: C0207FF7EA146678
2 changed files with 2 additions and 14 deletions

View file

@ -61,19 +61,6 @@ public final class StaticArgument<C> extends CommandArgument<C, String> {
return new StaticArgument<>(true, name, aliases);
}
/**
* Create a new static argument instance for an optional command argument
*
* @param name Argument name
* @param aliases Argument aliases
* @param <C> Command sender type
* @return Constructed argument
*/
public static <C> @NonNull StaticArgument<C> optional(final @NonNull String name,
final @NonNull String... aliases) {
return new StaticArgument<>(false, name, aliases);
}
/**
* Register a new alias
*

View file

@ -24,6 +24,7 @@
package cloud.commandframework;
import cloud.commandframework.arguments.StaticArgument;
import cloud.commandframework.arguments.standard.StringArgument;
import cloud.commandframework.meta.SimpleCommandMeta;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
@ -38,7 +39,7 @@ class CommandTest {
@Test
void ensureOrdering() {
Assertions.assertThrows(IllegalArgumentException.class, () ->
Command.newBuilder("test", SimpleCommandMeta.empty()).argument(StaticArgument.optional("something"))
Command.newBuilder("test", SimpleCommandMeta.empty()).argument(StringArgument.optional("something"))
.argument(StaticArgument.of("somethingelse")).build());
}