public interface Arguments
| Modifier and Type | Method and Description |
|---|---|
@NotNull ArgumentReader |
asReader()
Converts all arguments into an
ArgumentReader |
static void |
checkBounds(int i,
int size)
Checks if
i is smaller than size and at least 0 |
default <T> T |
get(int i,
ArgumentType<T> type)
Gets a specific argument
|
<T> @NotNull com.datasiqn.resultapi.Result<T,String> |
getChecked(int i,
ArgumentType<T> type)
Same as
get(int, ArgumentType), except checks if there is an error and returns a Result |
@NotNull String |
getString(int i)
Gets a simple string argument
|
int |
size()
Gets the size of the arguments
|
int size()
@NotNull
default <T> T get(int i,
ArgumentType<T> type)
T - The type of the argument typei - The index of the argumenttype - The argument typeIllegalArgumentException - If the argument could not be parsed into typeIndexOutOfBoundsException - If i is an invalid index (i < 0, or i >= size())@NotNull <T> @NotNull com.datasiqn.resultapi.Result<T,String> getChecked(int i, ArgumentType<T> type)
get(int, ArgumentType), except checks if there is an error and returns a ResultT - The type of the argument typei - The index of the argumenttype - The argument typeIndexOutOfBoundsException - If i is an invalid index (i < 0, or i >= size())@NotNull @NotNull String getString(int i)
i - The index of the argumentIndexOutOfBoundsException - if i is an invalid index (i < 0, or i >= size()@NotNull @NotNull ArgumentReader asReader()
ArgumentReaderArgumentReaderstatic void checkBounds(int i,
int size)
i is smaller than size and at least 0i - The number to checksize - The total sizeIndexOutOfBoundsException - If i >= size or i < 0Copyright © 2024. All rights reserved.