jaggregate
Class Throwables

java.lang.Object
  extended by jaggregate.Throwables

public class Throwables
extends Object

Utility class that offers useful operations on exceptions.

Version:
$Id: Throwables.java,v 1.6 2008/10/03 19:01:23 pholser Exp $
Author:
Paul Holser

Method Summary
static UnaryPredicate<Throwable> isThrownBy(Class<?> thrower)
          Answers a predicate which will answer true if its argument is an exception which was raised from code in the given class.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

isThrownBy

public static UnaryPredicate<Throwable> isThrownBy(Class<?> thrower)
Answers a predicate which will answer true if its argument is an exception which was raised from code in the given class.

An exception is considered to have been raised from a given class if its zeroth stack trace element mentions the class by name.

Parameters:
thrower - the comparand to use with the returned predicate
Returns:
a predicate that can be used to compare arguments with thrower


© Copyright 2004-2008 Paul R. Holser, Jr. All rights reserved. Licensed under the Academic Free License version 3.0. pholser@alumni.rice.edu