public abstract class CommandError extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
CommandError.Reason |
| Modifier and Type | Method and Description |
|---|---|
abstract <A> A |
fold(java.util.function.BiFunction<CommandError.Reason,String,A> str,
java.util.function.BiFunction<CommandError.Reason,Throwable,A> ex)
Access the reason value and either the string or the throwable context and return whatever you like.
|
abstract String |
getMessage()
The reason message acaessor
|
CommandError.Reason |
getReason()
The reason value acaessor
|
static CommandError |
of(CommandError.Reason reason,
String msg)
Construct a
CommandError from a Throwable |
static CommandError |
of(CommandError.Reason reason,
Throwable throwable)
Construct a
CommandError from a Throwable |
String |
toString() |
public static CommandError of(CommandError.Reason reason, Throwable throwable)
CommandError from a Throwablereason - the reason valuethrowable - for more contextCommandErrorpublic static CommandError of(CommandError.Reason reason, String msg)
CommandError from a Throwablereason - the reason valuemsg - for more contextCommandErrorpublic CommandError.Reason getReason()
public abstract String getMessage()
public abstract <A> A fold(java.util.function.BiFunction<CommandError.Reason,String,A> str, java.util.function.BiFunction<CommandError.Reason,Throwable,A> ex)
A - the result typestr - the function that receives the reason and string, returning a value of the specified typeex - the function that receives the reason and throwable, returning a value of the specified typeCopyright © 2018. All rights reserved.