checkState

open fun checkState(expression: Boolean)

Ensures the truth of an expression involving the state of the calling instance, but not involving any parameters to the calling method.

Parameters

expression

a boolean expression

Throws

if expression is false


open fun checkState(expression: Boolean, @Nullable errorMessage: Any)

Ensures the truth of an expression involving the state of the calling instance, but not involving any parameters to the calling method.

Parameters

expression

a boolean expression

errorMessage

the exception message to use if the check fails; will be converted to a string using valueOf

Throws

if expression is false