Class SetOfThrowables


  • public class SetOfThrowables
    extends Object
    • Method Detail

      • create

        public static SetOfThrowables create​(Class<? extends Throwable> clazz)
        Creates a set consisting of a single throwable class. The set can later be inspected using includes(Class).
        Parameters:
        clazz - a single throwable class to include in the set
        Returns:
        a singleton set of throwable classes
      • create

        public static SetOfThrowables create​(Collection<Class<? extends Throwable>> classes)
        Creates a set of throwable classes that can later be inspected using includes(Class).
        Parameters:
        classes - throwable classes to include in the set
        Returns:
        a set of throwable classes
      • includes

        public boolean includes​(Class<? extends Throwable> searchedFor)
        Parameters:
        searchedFor - a class to check
        Returns:
        whether searchedFor is a subtype of (at least) one of the types in this set. Note that subtyping is a reflexive relation, so a type is always a subtype of itself.