Package org.linkki.util
Class ExceptionSupplier
java.lang.Object
org.linkki.util.ExceptionSupplier
Helper class that for exception suppliers to simplify usage of
Optional.orElseThrow(Supplier).-
Method Summary
Modifier and TypeMethodDescriptionstatic 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 Details
-
illegalArgumentException
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
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.
-