Package org.linkki.util
Class ExceptionSupplier
- java.lang.Object
-
- org.linkki.util.ExceptionSupplier
-
public final class ExceptionSupplier extends Object
Helper class that for exception suppliers to simplify usage ofOptional.orElseThrow(Supplier).
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Supplier<IllegalArgumentException>illegalArgumentException(String message)Returns a supplier for anIllegalArgumentExceptionwith the given message.static Supplier<IllegalArgumentException>illegalArgumentException(String message, Throwable cause)Returns a supplier for anIllegalArgumentExceptionwith the given message and cause.static Supplier<IllegalStateException>illegalStateException(String message)Returns a supplier for anIllegalStateExceptionwith the given message.static Supplier<IllegalStateException>illegalStateException(String message, Throwable cause)Returns a supplier for anIllegalStateExceptionwith the given message and cause.
-
-
-
Method Detail
-
illegalArgumentException
public static Supplier<IllegalArgumentException> illegalArgumentException(String message)
Returns a supplier for anIllegalArgumentExceptionwith the given message.
-
illegalArgumentException
public static Supplier<IllegalArgumentException> illegalArgumentException(String message, Throwable cause)
Returns a supplier for anIllegalArgumentExceptionwith the given message and cause.
-
illegalStateException
public static Supplier<IllegalStateException> illegalStateException(String message)
Returns a supplier for anIllegalStateExceptionwith the given message.
-
illegalStateException
public static Supplier<IllegalStateException> illegalStateException(String message, Throwable cause)
Returns a supplier for anIllegalStateExceptionwith the given message and cause.
-
-