From 79aad9d79a1be447f891b8861ed3ae88f7f3a51d Mon Sep 17 00:00:00 2001 From: jmp Date: Mon, 14 Dec 2020 15:54:48 -0800 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20Add=20getters=20for=20permission=20?= =?UTF-8?q?and=20sender=20type=20to=20Command.Builder?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/cloud/commandframework/Command.java | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/cloud-core/src/main/java/cloud/commandframework/Command.java b/cloud-core/src/main/java/cloud/commandframework/Command.java index 4d965ed8..2fbd1064 100644 --- a/cloud-core/src/main/java/cloud/commandframework/Command.java +++ b/cloud-core/src/main/java/cloud/commandframework/Command.java @@ -307,6 +307,30 @@ public class Command { this.flags = Objects.requireNonNull(flags, "Flags may not be null"); } + /** + * Get the required sender type for this builder + *

+ * Returns {@code null} when there is not a specific required sender type + * + * @return required sender type + * @since 1.3.0 + */ + public @Nullable Class senderType() { + return this.senderType; + } + + /** + * Get the required command permission for this builder + *

+ * Will return {@link Permission#empty()} if there is no required permission + * + * @return required permission + * @since 1.3.0 + */ + public @NonNull CommandPermission commandPermission() { + return this.commandPermission; + } + /** * Add command meta to the internal command meta map *