Class Caused


  • public class Caused
    extends java.lang.Object
    A 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
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Caused

        public Caused()
    • 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()