cz.cuni.amis.utils
Class ExceptionDiscarder<T>

java.lang.Object
  extended by cz.cuni.amis.utils.ExceptionDiscarder<T>

public abstract class ExceptionDiscarder<T>
extends java.lang.Object

Used for adapting APIs throwing exceptions to usecases where this is not desired.


Constructor Summary
ExceptionDiscarder()
           
 
Method Summary
 T run()
           
protected abstract  T task()
          Specifies the task that should be computed.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ExceptionDiscarder

public ExceptionDiscarder()
Method Detail

task

protected abstract T task()
                   throws java.lang.Exception
Specifies the task that should be computed. the task can throw exception but it will be wrapped by run method to a RuntimeException.

Returns:
Throws:
java.lang.Exception

run

public T run()