Class ExpressionSafeRunnable<T>

  • All Implemented Interfaces:
    org.eclipse.core.runtime.ISafeRunnable

    public class ExpressionSafeRunnable<T>
    extends Object
    implements org.eclipse.core.runtime.ISafeRunnable
    The safe runnable based on lambda expressions.
    • Constructor Detail

      • ExpressionSafeRunnable

        public ExpressionSafeRunnable​(Consumer<T> runExpression,
                                      Consumer<Throwable> logExpression)
        Creates a new safe runnable wich exception processed.
        Parameters:
        runExpression - the expressions for run menthod.
        logExpression - the expressions for exception precessed.
      • ExpressionSafeRunnable

        public ExpressionSafeRunnable​(Consumer<T> runExpression)
        Creates a new safe runnable.
        Parameters:
        runExpression - the expressions for run menthod.
    • Method Detail

      • setObject

        public void setObject​(T object)
        Set object for run expressions.
        Parameters:
        object - the object for run expressions.
      • handleException

        public void handleException​(Throwable exception)
        Specified by:
        handleException in interface org.eclipse.core.runtime.ISafeRunnable
      • run

        public void run()
                 throws Exception
        Specified by:
        run in interface org.eclipse.core.runtime.ISafeRunnable
        Throws:
        Exception