Class ArgumentParseResult<T>
- java.lang.Object
-
- cloud.commandframework.arguments.parser.ArgumentParseResult<T>
-
- Type Parameters:
T
- Parser return type
public abstract class ArgumentParseResult<T> extends java.lang.Object
Result of the parsing done by aArgumentParser
-
-
Method Summary
Modifier and Type Method Description static <T> @NonNull ArgumentParseResult<T>
failure(@NonNull java.lang.Throwable failure)
Indicate that the parsing failedabstract @NonNull java.util.Optional<java.lang.Throwable>
getFailure()
Get the failure reason, if it existsabstract @NonNull java.util.Optional<T>
getParsedValue()
Get the parsed value, if it existsstatic <T> @NonNull ArgumentParseResult<T>
success(@NonNull T value)
Indicate that the parsing succeeded
-
-
-
Method Detail
-
failure
public static <T> @NonNull ArgumentParseResult<T> failure(@NonNull java.lang.Throwable failure)
Indicate that the parsing failed- Type Parameters:
T
- Parser return type- Parameters:
failure
- Failure reason- Returns:
- Failed parse result
-
success
public static <T> @NonNull ArgumentParseResult<T> success(@NonNull T value)
Indicate that the parsing succeeded- Type Parameters:
T
- Parser return type- Parameters:
value
- Value produced by the parser- Returns:
- Succeeded parse result
-
getParsedValue
public abstract @NonNull java.util.Optional<T> getParsedValue()
Get the parsed value, if it exists- Returns:
- Optional containing the parsed value
-
getFailure
public abstract @NonNull java.util.Optional<java.lang.Throwable> getFailure()
Get the failure reason, if it exists- Returns:
- Optional containing the failure reason
-
-