ApiResult
Toggle table of contents
common
Platform filter
common
Switch theme
Search in API
ApiResult
core
/
pro.respawn.apiresult
/
errorIfEmpty
error
If
Empty
inline
fun
<
T
,
R
:
Iterable
<
T
>
>
ApiResult
<
R
>
.
errorIfEmpty
(
exception
:
(
)
->
Exception
=
{ ConditionNotSatisfiedException("Collection was empty") }
)
:
ApiResult
<
R
>
@
JvmName
(
name
=
"sequenceErrorIfEmpty"
)
inline
fun
<
T
,
R
:
Sequence
<
T
>
>
ApiResult
<
R
>
.
errorIfEmpty
(
exception
:
(
)
->
Exception
=
{ ConditionNotSatisfiedException("Sequence was empty") }
)
:
ApiResult
<
R
>
Makes
this
an
error
if the collection is empty.