Class CommandMessageException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
tech.guilhermekaua.spigotboot.commands.CommandMessageException
- All Implemented Interfaces:
Serializable
Raised by a
CommandArgumentResolver to signal a specific, customizable failure.
The carried CommandMessageKey and placeholder values are rendered into the final
message by the command pipeline, letting a downstream CommandMessageSource
override the text per key.- See Also:
-
Method Summary
Modifier and TypeMethodDescriptiongetKey()static CommandMessageExceptionof(CommandMessageKey key) Binds a placeholder value for rendering.Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Method Details
-
of
- Parameters:
key- the message key describing this failure; must not benull- Returns:
- a new exception carrying
keyand no placeholders yet
-
with
Binds a placeholder value for rendering.- Parameters:
name- the placeholder name (without braces); must not benullvalue- the value; may benull- Returns:
- this exception, for chaining
-
getKey
- Returns:
- the key describing this failure
-
getPlaceholders
- Returns:
- an unmodifiable view of the bound placeholder values
-
getMessage
- Overrides:
getMessagein classThrowable
-