Package io.smallrye.mutiny.helpers
Class Caused
- java.lang.Object
-
- io.smallrye.mutiny.helpers.Caused
-
public class Caused extends java.lang.ObjectA utility class that creates a predicate on a throwable. If the tested throwable is a runtime exception that has a cause, it unwraps the cause and checks if it is assignable to the cause class provided on predicate creation. It is a companion to the unchecked utilities which wraps checked exceptions into unchecked Runtime exceptions. If the tested throwable has cause, the assignment check will occur on the throwable itself.
-
-
Constructor Summary
Constructors Constructor Description Caused()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.util.function.Predicate<java.lang.Throwable>by(java.lang.Class<? extends java.lang.Throwable> cause)Create a predicate
-
-
-
Method Detail
-
by
public static java.util.function.Predicate<java.lang.Throwable> by(java.lang.Class<? extends java.lang.Throwable> cause)
Create a predicate- Parameters:
cause- the throwable type want to check- Returns:
- a predicate which can be used in
Uni.onFailure()
-
-