Class Exceptions
java.lang.Object
io.github.torand.javacommons.lang.Exceptions
Provides factory methods to create exception objects with customized messages.
-
Method Summary
Modifier and TypeMethodDescriptionstatic Supplier
<IllegalArgumentException> illegalArgumentException
(String message, Object... args) Creates a supplier of IllegalArgumentException with a customized message.static Supplier
<IllegalStateException> illegalStateException
(String message, Object... args) Creates a supplier of IllegalStateException with a customized message.static Supplier
<RuntimeException> runtimeException
(String message, Object... args) Creates a supplier of RuntimeException with a customized message.
-
Method Details
-
illegalStateException
Creates a supplier of IllegalStateException with a customized message.- Parameters:
message
- the message.args
- the message parameters.- Returns:
- the supplier.
-
illegalArgumentException
public static Supplier<IllegalArgumentException> illegalArgumentException(String message, Object... args) Creates a supplier of IllegalArgumentException with a customized message.- Parameters:
message
- the message.args
- the message parameters.- Returns:
- the supplier.
-
runtimeException
Creates a supplier of RuntimeException with a customized message.- Parameters:
message
- the message.args
- the message parameters.- Returns:
- the supplier.
-