Helper class used by code generated by the require
macro.
Helper class used by code generated by the require
macro.
Require that a boolean condition about an argument passed to a method, function, or constructor,
and described in the given clue
, is true.
Require that a boolean condition about an argument passed to a method, function, or constructor,
and described in the given clue
, is true.
If the condition is true
, this method returns normally.
Else, it throws IllegalArgumentException
with the
String
obtained by invoking toString
on the
specified clue
and appending that to the macro-generated
error message as the exception's detail message.
the boolean condition to check as requirement
an objects whose toString
method returns a message to include in a failure report.
IllegalArgumentException
if the condition is false
.
NullPointerException
if message
is null
.
Require that a boolean condition is true about an argument passed to a method, function, or constructor.
Require that a boolean condition is true about an argument passed to a method, function, or constructor.
If the condition is true
, this method returns normally.
Else, it throws IllegalArgumentException
.
This method is implemented in terms of a Scala macro that will generate an error message. See the main documentation for this trait for examples.
the boolean condition to check as requirement
IllegalArgumentException
if the condition is false
.
Require that all passed arguments are non-null.
Require that all passed arguments are non-null.
If none of the passed arguments are null
, this method returns normally.
Else, it throws NullArgumentException
with an error message that includes the name
(as it appeared in the source) of each argument that was null
.
arguments to check for null
value
NullArgumentException
if any of the arguments are null
.
Require that a boolean condition about the state of an object on which a method has been
invoked, and described in the given clue
, is true.
Require that a boolean condition about the state of an object on which a method has been
invoked, and described in the given clue
, is true.
If the condition is true
, this method returns normally.
Else, it throws IllegalStateException
with the
String
obtained by invoking toString
on the
specified clue
appended to the macro-generated error message
as the exception's detail message.
the boolean condition to check as a requirement
an object whose toString
method returns a message to include in a failure report.
IllegalStateException
if the condition is false
.
NullPointerException
if message
is null
.
Require that a boolean condition is true about the state of an object on which a method has been invoked.
Require that a boolean condition is true about the state of an object on which a method has been invoked.
If the condition is true
, this method returns normally.
Else, it throws IllegalStateException
.
This method is implemented in terms of a Scala macro that will generate an error message.
the boolean condition to check as requirement
IllegalStateException
if the condition is false
.
Helper instance used by code generated by macro assertion.
Companion object that facilitates the importing of
Requirements
members as an alternative to mixing it in. One use case is to importRequirements
members so you can use them in the Scala interpreter: