Package: org.apache.groovy.ginq.provider.collection.runtime

## [Groovy] Class QueryableHelper

- org.apache.groovy.ginq.provider.collection.runtime.QueryableHelper

-     @Internal
      @CompileStatic
      class QueryableHelper
      extends Object

  Helper for Queryable

  Since:
    4.0.0

- - ### Properties Summary

    Properties
    Type | Name and description
    --- | ---
    `String` | `var`

  - ### Methods Summary

    Methods
    Type Params | Return Type | Name and description
    --- | --- | ---
    `<T>` | `static T` | `getVar(String name)` Returns a named execution variable from the thread-local context.
    `` | `static boolean` | `isParallel()` Indicates whether the current query is executing in parallel mode.
    `<T>` | `static Queryable<SourceRecord<T>>` | `navigate(Queryable<? extends T> queryable, List<String> aliasList)` Make Queryable instance's data source records being able to access via aliases
    `<T>` | `static T` | `removeVar(String name)` Removes a named execution variable from the thread-local context.
    `<T>` | `static void` | `setVar(String name, T value)` Stores a named execution variable in the thread-local context.
    `` | `static void` | `shutdown(int mode)` Shutdown to release resources
    `<T>` | `static T` | `singleValue(Queryable<? extends T> queryable)` Returns single value of Queryable instance
    `<T>` | `static ForkJoinTask<T>` | `submit(Callable<T> callable)` Submits work to the shared fork-join pool.
    `<U>` | `static CompletableFuture<U>` | `supplyAsync(Supplier<U> supplier)` Executes a supplier asynchronously on the shared thread pool.
    `<T, U>` | `static CompletableFuture<U>` | `supplyAsync(Function<? super T, ? extends U> function, T param)` Executes a single-argument function asynchronously on the shared thread pool.

  - ### Inherited Methods Summary

    Inherited Methods
    Methods inherited from class | Name
    --- | ---
    `class Object` | `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Property Detail

    - #### String var

  - ### Method Detail

    - #### <T> static T getVar(String name)

      Returns a named execution variable from the thread-local context.

      Parameters:
        `name` - the variable name
      Returns:
        the stored value

    - #### static boolean isParallel()

      Indicates whether the current query is executing in parallel mode.

      Returns:
        `true` if parallel mode is enabled

    - #### <T> static Queryable<SourceRecord<T>> navigate(Queryable<? extends T> queryable, List<String> aliasList)

      Make Queryable instance's data source records being able to access via aliases

      Parameters:
        `queryable` - the original Queryable instance
        `aliasList` - the aliases of clause `from` and joins
      Returns:
        the result Queryable instance
      Since:
        4.0.0

    - #### <T> static T removeVar(String name)

      Removes a named execution variable from the thread-local context.

      Parameters:
        `name` - the variable name
      Returns:
        the removed value

    - #### <T> static void setVar(String name, T value)

      Stores a named execution variable in the thread-local context.

      Parameters:
        `name` - the variable name
        `value` - the variable value

    - #### static void shutdown(int mode)

      Shutdown to release resources

      Parameters:
        `mode` - 0: immediate, 1: abort

    - #### <T> static T singleValue(Queryable<? extends T> queryable)

      Returns single value of Queryable instance

      throws:
        TooManyValuesException if the Queryable instance contains more than one value
      Parameters:
        `queryable` - the Queryable instance
      Returns:
        the single value
      Since:
        4.0.0

    - #### <T> static ForkJoinTask<T> submit(Callable<T> callable)

      Submits work to the shared fork-join pool.

      Parameters:
        `callable` - the task to submit
      Returns:
        the submitted task

    - #### <U> static CompletableFuture<U> supplyAsync(Supplier<U> supplier)

      Executes a supplier asynchronously on the shared thread pool.

      Parameters:
        `supplier` - the supplier to execute
      Returns:
        the asynchronous result

    - #### <T, U> static CompletableFuture<U> supplyAsync(Function<? super T, ? extends U> function, T param)

      Executes a single-argument function asynchronously on the shared thread pool.

      Parameters:
        `function` - the function to execute
        `param` - the argument passed to the function
      Returns:
        the asynchronous result