Skip to content

Commit

Permalink
Use SAM constructors for Kotlin extensions.
Browse files Browse the repository at this point in the history
Closes #1111.
  • Loading branch information
mp911de committed Mar 29, 2021
1 parent 30775b0 commit 024214f
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ inline fun <reified T : Any> AsyncCqlOperations.queryForObject(cql: String, vara
* Extension for [AsyncCqlOperations.queryForObject] leveraging reified type parameters.
*/
fun <T : Any> AsyncCqlOperations.queryForObject(cql: String, vararg args: Any, function: (Row, Int) -> T): ListenableFuture<T?> =
queryForObject(cql, function, *args)
queryForObject(cql, RowMapper { row, i -> function(row, i) }, *args)

/**
* Extension for [AsyncCqlOperations.queryForObject] providing a [KClass] based variant.
Expand Down Expand Up @@ -113,4 +113,4 @@ inline fun <reified T : Any> AsyncCqlOperations.query(cql: String, vararg args:
* variant: `query("...", arg1, argN){ row, i -> }`.
*/
fun <T : Any> AsyncCqlOperations.query(cql: String, vararg args: Any, function: (Row, Int) -> T): ListenableFuture<List<T>> =
query(cql, { row, i -> function(row, i) }, *args)
query(cql, RowMapper { row, i -> function(row, i) }, *args)

0 comments on commit 024214f

Please sign in to comment.