com.faunos.util
Class ThrowFactory<E extends Throwable,T extends E>
java.lang.Object
com.faunos.util.ThrowFactory<E,T>
public class ThrowFactory<E extends Throwable,T extends E>
- extends Object
An exception factory. This is mostly used in utility classes that
want to centralize, and abstract away the type of exception thrown when an error
condition is met. In practice, this means that the parameterized
type T
will be a RuntimeException
subclass.
Note:
I have changed my mind about checked exceptions: I now think they are
a bad idea.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ThrowFactory
public ThrowFactory(Class<T> throwableClass)
create
public E create()
create
public E create(String message)
create
public E create(Throwable cause)
create
public E create(String message,
Throwable cause)
getExceptionClass
public Class<T> getExceptionClass()