Check that a condition is true for the value
.
Check that a condition is true for the value
. If true, return value
,
otherwise throw an IllegalArgumentException
with the given message.
The function used to check the value
.
The message to report if the condition isn't met.
Check that a condition is true.
Check that a condition is true. If true, return value
, otherwise throw
an IllegalArgumentException
with the given message.
The condition to check.
The message to report if the condition isn't met.
The value to check.
Check that a condition is true for the value
.
Check that a condition is true for the value
. If true, return value
,
otherwise throw an IllegalArgumentException
with the given message.
The function used to check the value
.
The message to report if the condition isn't met.
(requiring: Requiring[Requiring[A]]).requiring(cond, msg)
Check that a condition is true.
Check that a condition is true. If true, return value
, otherwise throw
an IllegalArgumentException
with the given message.
The condition to check.
The message to report if the condition isn't met.
(requiring: Requiring[Requiring[A]]).requiring(cond, msg)
The value to check.
The value to check.
(requiring: Requiring[Requiring[A]]).value
Implicit class providing
requiring
methods. This class is based onPredef.ensuring
in the Scala standard library. The difference is that this class's methods throwIllegalArgumentException
s rather thanAssertionError
s.An example adapted from
Predef
's documentation: