Creates a new instance of exception.
Creates a new instance of exception. Default implementation uses RequireCore.DefaultExceptionCreator exception creator.
the message (must be non-blank)
the cause exception (must be non-null and not Some(null)
)
new exception instance (non-null)
RuntimeException
if any argument is not valid
Fails test.
Fails test. Must be invoked at every time when requireXXX
method fails. Default implementation
invokes exception()
to create new exception instance with message produced by failureMessage()
method
and throws the result.
the String
to include in the failure message (must be non-null)
RuntimeException
at every invokation
Constructs the failure message.
Constructs the failure message. Default implementation invokes toString()
method of message
and returns result.
the source message (must be non-null)
the failure message (non-null)
RuntimeException
if message
is null
Wraps predicate RequirePredicate to element function RequireElementFunction.
Wraps predicate RequirePredicate to element function RequireElementFunction.
the type of element
the predicate (must be non-null)
the new RequireElementFunction instance
Wraps predicate RequirePredicate to element function RequireFunction.
Wraps predicate RequirePredicate to element function RequireFunction.
the type of element
the predicate (must be non-null)
the new RequireFunction instance
Invokes requirement
to test an expression and calls fail if it returns false
.
Invokes requirement
to test an expression and calls fail if it returns false
.
the expression to test
a String
to include in the failure message (must be non-null)
RuntimeException
if requirement
invokation returns false
of any argument is not valid
Test that value
is equal to number
, and otherwise throws RequireCore.exception().
Test that value
is equal to number
, and otherwise throws RequireCore.exception().
the type of iterable elements
the value (must be non-null)
the required number (must be non-null)
the name to include in the failure message (must be non-null)
RuntimeException
if test fails
Tests that value
is from leftBound
until maximum value of type T
(inclusive),
and otherwise throws RequireCore.exception().
Tests that value
is from leftBound
until maximum value of type T
(inclusive),
and otherwise throws RequireCore.exception().
the type of value
the value (must be non-null)
the left bound (must be non-null)
the name to include in the failure message (must be non-null)
RuntimeException
if test fails
Tests that value
is from leftBound
until rightBound
, and otherwise throws RequireCore.exception().
Tests that value
is from leftBound
until rightBound
, and otherwise throws RequireCore.exception().
the type of value
the value (must be non-null)
the left bound (must be non-null)
the right bound (must be non-null)
RuntimeException
if test fails
Tests that value
is from minimum value of type T
(inclusive) until rightBound
,
and otherwise throws RequireCore.exception().
Tests that value
is from minimum value of type T
(inclusive) until rightBound
,
and otherwise throws RequireCore.exception().
the type of value
the value (must be non-null)
the right bound (must be non-null)
the name to include in the failure message (must be non-null)
RuntimeException
if test fails
requireXXX
methods to test numeric ranges.0.0.1