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
requiringmethods. This class is based onPredef.ensuringin the Scala standard library. The difference is that this class's methods throwIllegalArgumentExceptions rather thanAssertionErrors.An example adapted from
Predef's documentation: