failIf

inline fun failIf(predicate: Boolean, errorMessage: () -> String)(source)

Delegates to check but inverting the predicate, i.e. throws an IllegalStateException if predicate is true.

Since

1.1.0

Parameters

predicate

the predicate which defines if the exception should be thrown or not.

errorMessage

The message which as IllegalStateException.message