public class Arguments
extends xyz.srnyx.javautilities.parents.Stringable
| Modifier and Type | Field and Description |
|---|---|
@Nullable java.lang.String[] |
args
The arguments
|
| Constructor and Description |
|---|
Arguments(@Nullable java.lang.String[] args)
Construct a new
Arguments with the specified arguments |
| Modifier and Type | Method and Description |
|---|---|
boolean |
argEquals(int index,
java.lang.String... strings)
Returns if the specified
args index is equal to any of the specified strings (case-insensitive) |
@Nullable java.lang.String |
getArgument(int index)
Gets the argument at the specified index
|
@NotNull java.util.Optional<java.lang.String> |
getArgumentOptional(int index)
Gets the argument at the specified index as an
Optional |
@NotNull java.lang.String |
getArgumentsJoined()
Gets all arguments joined together
If no arguments are found, it returns an empty string |
@NotNull java.lang.String |
getArgumentsJoined(int start)
Gets multiple arguments joined together starting from the specified index
If no arguments are found, it returns an empty string |
@NotNull java.lang.String |
getArgumentsJoined(int start,
int end)
Gets multiple arguments joined together starting from the specified index and ending at the specified index (if too high, it will stop at the last argument)
If no arguments are found, it returns an empty string |
public Arguments(@Nullable
@Nullable java.lang.String[] args)
Arguments with the specified argumentsargs - the argumentspublic boolean argEquals(int index,
@Nullable
java.lang.String... strings)
args index is equal to any of the specified strings (case-insensitive)index - the argument indexstrings - the strings to compare totrue if the specified args index is equal to any of the specified strings (case-insensitive)@Nullable public @Nullable java.lang.String getArgument(int index)
index - the argument index@NotNull public @NotNull java.util.Optional<java.lang.String> getArgumentOptional(int index)
Optionalindex - the argument indexOptional@NotNull
public @NotNull java.lang.String getArgumentsJoined(int start,
int end)
start - the starting indexend - the ending index@NotNull public @NotNull java.lang.String getArgumentsJoined(int start)
start - the starting index@NotNull public @NotNull java.lang.String getArgumentsJoined()