org.eclipse.ease.tools

## Class RunnableWithResult<T>

- java.lang.Object
- - org.eclipse.ease.tools.RunnableWithResult<T>

All Implemented Interfaces:
  java.lang.Runnable

    public abstract class RunnableWithResult<T>
    extends java.lang.Object
    implements java.lang.Runnable

### Constructor Summary

Constructors
Constructor and Description
`RunnableWithResult()`

### Method Summary

All Methods Instance Methods Abstract Methods Concrete Methods
`T` `getResult()` Get the result of the run execution.
`T` `getResultOrThrow()` Get the result of the run execution.
`void` `run()`
`abstract T` `runWithTry()` Run method to be implemented by the derived class.

### Methods inherited from class java.lang.Object

`equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### RunnableWithResult

    public RunnableWithResult()

### Method Detail

#### run

    public final void run()

Specified by:
  `run` in interface `java.lang.Runnable`

#### getResult

    public T getResult()
                throws java.lang.RuntimeException

Get the result of the run execution. In case an exception was thrown it gets rethrown encapsulated in a `RuntimeException`.

Returns:
  runnable result
Throws:
  `java.lang.RuntimeException` - encapsulated exception encountered during run

#### getResultOrThrow

    public T getResultOrThrow()
                       throws java.lang.Throwable

Get the result of the run execution. Does rethrow exceptions that occurred during the run.

Returns:
  runnable result
Throws:
  `java.lang.RuntimeException` - encapsulated exception encountered during run
  `java.lang.Throwable`

#### runWithTry

    public abstract T runWithTry()
                          throws java.lang.Throwable

Run method to be implemented by the derived class. Exceptions thrown will automatically get caught an rethrown on a `getResult()`.

Throws:
  `java.lang.Throwable`