RunnableCallable (Apache Hadoop HttpFS 3.5.0 API)
Description: declaration: package: org.apache.hadoop.lib.lang, class: RunnableCallable

Package org.apache.hadoop.lib.lang

# Class RunnableCallable

java.lang.Object
org.apache.hadoop.lib.lang.RunnableCallable

All Implemented Interfaces:
  `Runnable`, `Callable<Void>`

@Private public class RunnableCallable extends Object implements Callable<Void>, Runnable
Adapter class that allows `Runnable`s and `Callable`s to be treated as the other.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `RunnableCallable(Runnable runnable)`
  Constructor that takes a runnable.
  `RunnableCallable(Callable<?> callable)`
  Constructor that takes a callable.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `Void`
  `call()`
  Invokes the wrapped callable/runnable as a callable.
  `void`
  `run()`
  Invokes the wrapped callable/runnable as a runnable.
  `String`
  `toString()`
  Returns the class name of the wrapper callable/runnable.

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

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- ## Constructor Details

  - ### RunnableCallable

    public RunnableCallable(Runnable runnable)
    Constructor that takes a runnable.
    Parameters:
      `runnable` - runnable.

  - ### RunnableCallable

    public RunnableCallable(Callable<?> callable)
    Constructor that takes a callable.
    Parameters:
      `callable` - callable.

- ## Method Details

  - ### call

    public Void call() throws Exception
    Invokes the wrapped callable/runnable as a callable.
    Specified by:
      `call` in interface `Callable<Void>`
    Returns:
      void
    Throws:
      `Exception` - thrown by the wrapped callable/runnable invocation.

  - ### run

    public void run()
    Invokes the wrapped callable/runnable as a runnable.
    Specified by:
      `run` in interface `Runnable`
    Throws:
      `RuntimeException` - thrown by the wrapped callable/runnable invocation.

  - ### toString

    public String toString()
    Returns the class name of the wrapper callable/runnable.
    Overrides:
      `toString` in class `Object`
    Returns:
      the class name of the wrapper callable/runnable.