From eb07fd1a2f904fbae4ae581de90848ea04e1e093 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20S=C3=B6derberg?= Date: Sat, 3 Oct 2020 22:44:36 +0200 Subject: [PATCH] :art: Remove StaticArgument#Optional Not needed with the introduction of the flag system. This closes #15. --- .../commandframework/arguments/StaticArgument.java | 13 ------------- .../java/cloud/commandframework/CommandTest.java | 3 ++- 2 files changed, 2 insertions(+), 14 deletions(-) diff --git a/cloud-core/src/main/java/cloud/commandframework/arguments/StaticArgument.java b/cloud-core/src/main/java/cloud/commandframework/arguments/StaticArgument.java index a790f73b..e8a2e666 100644 --- a/cloud-core/src/main/java/cloud/commandframework/arguments/StaticArgument.java +++ b/cloud-core/src/main/java/cloud/commandframework/arguments/StaticArgument.java @@ -61,19 +61,6 @@ public final class StaticArgument extends CommandArgument { 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 Command sender type - * @return Constructed argument - */ - public static @NonNull StaticArgument optional(final @NonNull String name, - final @NonNull String... aliases) { - return new StaticArgument<>(false, name, aliases); - } - /** * Register a new alias * diff --git a/cloud-core/src/test/java/cloud/commandframework/CommandTest.java b/cloud-core/src/test/java/cloud/commandframework/CommandTest.java index 6ed6318c..ac17d847 100644 --- a/cloud-core/src/test/java/cloud/commandframework/CommandTest.java +++ b/cloud-core/src/test/java/cloud/commandframework/CommandTest.java @@ -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()); }