Skip to content

Commit

Permalink
Return non-nullable type from the fetchOne method. (#562)
Browse files Browse the repository at this point in the history
To return nullable type, use the fetchOneOrNull method instead.
  • Loading branch information
nakamura-to committed Sep 13, 2020
1 parent 076eb5c commit d3985fb
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,11 @@ interface KListable<ELEMENT> : KStatement<List<ELEMENT>> {
return execute()
}

fun fetchOne(): ELEMENT? {
fun fetchOne(): ELEMENT {
return execute().first()
}

fun fetchOneOrNull(): ELEMENT? {
return execute().firstOrNull()
}

Expand Down

0 comments on commit d3985fb

Please sign in to comment.