Package net.obvj.confectory.util
Class Exceptions
- java.lang.Object
-
- net.obvj.confectory.util.Exceptions
-
public final class Exceptions extends Object
Shorthands creating exceptions with a formatted message.- Since:
- 0.1.0
- Author:
- oswaldo.bapvic.jr (Oswaldo Junior)
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static IllegalArgumentExceptionillegalArgument(String format, Object... args)Creates anIllegalArgumentExceptionwith a formatted message.static IllegalArgumentExceptionillegalArgument(Throwable cause, String format, Object... args)Creates anIllegalArgumentExceptionwith a cause and a formatted message.static IllegalStateExceptionillegalState(String format, Object... args)Creates anIllegalStateExceptionwith a formatted message.static IllegalStateExceptionillegalState(Throwable cause, String format, Object... args)Creates anIllegalStateExceptionwith a cause and a formatted message.
-
-
-
Method Detail
-
illegalArgument
public static IllegalArgumentException illegalArgument(String format, Object... args)
Creates anIllegalArgumentExceptionwith a formatted message.- Parameters:
format- SeeString.format(String, Object...)args- SeeString.format(String, Object...)- Returns:
- an
IllegalArgumentExceptionwith a formatted message
-
illegalArgument
public static IllegalArgumentException illegalArgument(Throwable cause, String format, Object... args)
Creates anIllegalArgumentExceptionwith a cause and a formatted message.- Parameters:
cause- the cause to be setformat- SeeString.format(String, Object...)args- SeeString.format(String, Object...)- Returns:
- an
IllegalArgumentExceptionwith given cause a formatted message
-
illegalState
public static IllegalStateException illegalState(String format, Object... args)
Creates anIllegalStateExceptionwith a formatted message.- Parameters:
format- SeeString.format(String, Object...)args- SeeString.format(String, Object...)- Returns:
- an
IllegalStateExceptionwith a formatted message
-
illegalState
public static IllegalStateException illegalState(Throwable cause, String format, Object... args)
Creates anIllegalStateExceptionwith a cause and a formatted message.- Parameters:
cause- the cause to be setformat- SeeString.format(String, Object...)args- SeeString.format(String, Object...)- Returns:
- an
IllegalStateExceptionwith given cause and formatted message
-
-