com.holonplatform.datastore.jdbc.composer

## Interface SQLResultConverter<R>

- Type Parameters:
    `R` - Conversion result type
  All Known Implementing Classes:
    CallbackSQLResultConverter

      public interface SQLResultConverter<R>

  Converter to convert a `SQLResult` into another result type.
  Since:
    5.1.0

- - ### Method Summary

    All Methods Static Methods Instance Methods Abstract Methods Default Methods
    Modifier and Type | Method and Description
    --- | ---
    `R` | `convert(SQLExecutionContext context, SQLResult result)` Convert a `SQLResult` into expected result type.
    `static <R> SQLResultConverter<R>` | `create(Class<? extends R> conversionType, BiFunction<SQLExecutionContext,SQLResult,R> conversionFunction)` Create a new `SQLResultConverter` for given `conversionType`, using provided `BiFunction` as result conversion strategy.
    `Class<? extends R>` | `getConversionType()` Get the type into which this converter is able to convert a `SQLResult`.

- - ### Method Detail

    - #### getConversionType

          Class<? extends R> getConversionType()

      Get the type into which this converter is able to convert a `SQLResult`.
      Returns:
        The conversion type

    - #### convert

          R convert(SQLExecutionContext context,
                    SQLResult result)
             throws SQLException

      Convert a `SQLResult` into expected result type.
      Parameters:
        `context` - SQL execution context
        `result` - The result to convert
      Returns:
        Converted result
      Throws:
        `SQLException` - If an error occurred

    - #### create

          static <R> SQLResultConverter<R> create(Class<? extends R> conversionType,
                                                  BiFunction<SQLExecutionContext,SQLResult,R> conversionFunction)

      Create a new `SQLResultConverter` for given `conversionType`, using provided `BiFunction` as result conversion strategy.
      Type Parameters:
        `R` - Conversion result type
      Parameters:
        `conversionType` - Conversion type (not null)
        `conversionFunction` - Conversion function (not null)
      Returns:
        A new `SQLResultConverter`

Copyright © 2019 The Holon Platform. All rights reserved.