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
Invokes require function if value is Some(_) and do nothing otherwise.
Invokes require function if value is Some(_) and do nothing otherwise.
the type of value
the value (must be non-null)
the function (must be non-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
Calls require for all elements of iterable value.
Calls require for all elements of iterable value. The require must test the element and
throws RequireCore.exception() if it's not satisfy the requirements.
the type of iterable elements
the iterable value (must be non-null)
the name to include in the failure message (must be non-null)
the test function (must be non-null)
RuntimeException if test fails
Tests that iterable value does not contain blank (null or empty) strings, and
otherwise throws RequireCore.exception().
Tests that iterable value does not contain blank (null or empty) strings, and
otherwise throws RequireCore.exception().
the iterable value (must be non-null)
the name to include in the failure message (must be non-null)
Tests that iterable value does not contain null values, and
otherwise throws RequireCore.exception().
Tests that iterable value does not contain null values, and
otherwise throws RequireCore.exception().
the type of iterable elements
the iterable value (must be non-null)
the name to include in the failure message (must be non-null)
Calls predicate for all elements of iterable value.
Calls predicate for all elements of iterable value. It throws RequireCore.exception() if
there's an element that does not satisfy the requirements.
the type of iterable elements
the iterable value (must be non-null)
the name to include in the failure message (must be non-null)
the predicate (must be non-null)
RuntimeException if test fails
Tests that value is a Byte number string, and otherwise throws IllegalArgumentException.
Tests that value is a Byte number string, and otherwise throws IllegalArgumentException.
the value to test
the name to include in the failure message
Tests that value is a Double number string, and otherwise throws IllegalArgumentException.
Tests that value is a Double number string, and otherwise throws IllegalArgumentException.
the value to test
the name to include in the failure message
Tests that string email is a correct email address,
and otherwise throws RequireCore.exception().
Tests that string email is a correct email address,
and otherwise throws RequireCore.exception().
the testing email string (must be non-null)
the name to include in the failure message (must be non-null)
RuntimeException if test fails
Tests that value is a Float number string, and otherwise throws IllegalArgumentException.
Tests that value is a Float number string, and otherwise throws IllegalArgumentException.
the value to test
the name to include in the failure message
Tests that value is an Int number string, and otherwise throws IllegalArgumentException.
Tests that value is an Int number string, and otherwise throws IllegalArgumentException.
the value to test
the name to include in the failure message
Tests that value is a Long number string, and otherwise throws IllegalArgumentException.
Tests that value is a Long number string, and otherwise throws IllegalArgumentException.
the value to test
the name to include in the failure message
Tests that value is negative, and otherwise throws RequireCore.exception().
Tests that value is negative, and otherwise throws RequireCore.exception().
the value to test (must be non-null)
the name to include in the failure message (must be non-null)
RuntimeException if test fails
Tests that value is positive or zero, and otherwise throws RequireCore.exception().
Tests that value is positive or zero, and otherwise throws RequireCore.exception().
the value to test (must be non-null)
the name to include in the failure message (must be non-null)
RuntimeException if test fails
Tests that value is negative or zero, and otherwise throws RequireCore.exception().
Tests that value is negative or zero, and otherwise throws RequireCore.exception().
the value to test (must be non-null)
the name to include in the failure message (must be non-null)
RuntimeException if test fails
Tests that sequence value isn't null or empty, and otherwise throws RequireCore.exception().
Tests that sequence value isn't null or empty, and otherwise throws RequireCore.exception().
the type of iterable elements
the iterable to test
RuntimeException if test fails
Tests that sequence value isn't null or empty, and otherwise throws RequireCore.exception().
Tests that sequence value isn't null or empty, and otherwise throws RequireCore.exception().
the type of iterable elements
the iterable to test
the name to include in the failure message
RuntimeException if test fails
Tests that value isn't null or empty (after trim), and otherwise throws RequireCore.exception().
Tests that value isn't null or empty (after trim), and otherwise throws RequireCore.exception().
the value to test (must be non-null)
the name to include in the failure message (must be non-null)
RuntimeException if test fails
Tests that value isn't null, and otherwise throws RequireCore.exception().
Tests that value isn't null, and otherwise throws RequireCore.exception().
the value to test
the name to include in the failure message (must be non-null)
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
Tests that value matches regular expression pattern, and otherwise throws RequireCore.exception().
Tests that value matches regular expression pattern, and otherwise throws RequireCore.exception().
the value to test (must be non-null)
the pattern to test (must be non-null)
the name to include in the failure message (must be non-null)
RuntimeException if test fails
Tests that value is positive, and otherwise throws RequireCore.exception().
Tests that value is positive, and otherwise throws RequireCore.exception().
the value to test (must be non-null)
the name to include in the failure message (must be non-null)
RuntimeException if test fails
Tests that value is a Short number string, and otherwise throws IllegalArgumentException.
Tests that value is a Short number string, and otherwise throws IllegalArgumentException.
the value to test
the name to include in the failure message
Tests that size of iterable value equals size, and otherwise throws RequireCore.exception().
Tests that size of iterable value equals size, and otherwise throws RequireCore.exception().
the type of iterable elements
the iterable value (must be non-null)
the expected size (must be positive)
the name to include in the failure message (must be non-null)
RuntimeException if test fails
Tests that size of iterable value is from from inclusive until Int.MaxValue inclusive,
and otherwise throws RequireCore.exception().
Tests that size of iterable value is from from inclusive until Int.MaxValue inclusive,
and otherwise throws RequireCore.exception().
the type of iterable elements
the iterable value (must be non-null)
the minimum size value (inclusive)
the name to include in the failure message (must be non-null)
RuntimeException if test fails
Tests that size of iterable value is from from inclusive until until exclusive,
and otherwise throws RequireCore.exception().
Tests that size of iterable value is from from inclusive until until exclusive,
and otherwise throws RequireCore.exception().
the type of iterable elements
the iterable value (must be non-null)
the minimum size value (inclusive)
the maximum size value (exclusive)
the name to include in the failure message (must be non-null)
RuntimeException if test fails
Tests that size of iterable value is from 0 inclusive until until exclusive,
and otherwise throws RequireCore.exception().
Tests that size of iterable value is from 0 inclusive until until exclusive,
and otherwise throws RequireCore.exception().
the type of iterable elements
the iterable value (must be non-null)
the maximum size value (exclusive)
the name to include in the failure message (must be non-null)
RuntimeException if test fails
Test that all elements of iterable value has unique value of field extracted by extractor.
Test that all elements of iterable value has unique value of field extracted by extractor.
the iterable element type
the testing field type
the testing iterable (must be non-null)
the name to include in the failure message (must be non-blank)
the field name to include in the failure message (must be non-blank)
the extractor function to extract field value from instance of T (must be non-null)
Tests that string uuid is a correct universally unique identifier (UUID),
and otherwise throws RequireCore.exception().
Tests that string uuid is a correct universally unique identifier (UUID),
and otherwise throws RequireCore.exception().
the testing uuid string (must be non-null)
the name to include in the failure message (must be non-null)
RuntimeException if test fails
Default implementation containing all
requireXXXmethods.0.0.4