File tree Expand file tree Collapse file tree 1 file changed +22
-0
lines changed
src/main/java/me/despical/commandframework Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -141,6 +141,28 @@ public String getArgument(int index) {
141141 return arguments .length > index && index >= 0 ? arguments [index ] : null ;
142142 }
143143
144+ /**
145+ * Gets the first argument.
146+ *
147+ * @return The first argument, or {@code null} if no arguments exist.
148+ */
149+ @ Nullable
150+ @ Contract (pure = true )
151+ public String getFirst () {
152+ return this .getArgument (0 );
153+ }
154+
155+ /**
156+ * Gets the last argument.
157+ *
158+ * @return The last argument, or {@code null} if no arguments exist.
159+ */
160+ @ Nullable
161+ @ Contract (pure = true )
162+ public String getLast () {
163+ return this .getArgument (arguments .length - 1 );
164+ }
165+
144166 /**
145167 * Returns the indexed element from the arguments array, or the {@code defaultValue}
146168 * if and only if index is out the bounds.
You can’t perform that action at this time.
0 commit comments