- Type Parameters:
T
- The type of the value to be validatedX
- The type of the exception that is thrown by default if the value fails a test (this can be overridden for individual tests in the chain of checks)
-
Method Summary
Modifier and TypeMethodDescriptionand
(int arg) Returns anIntCheck
instance for validating the specified value.Returns anIntCheck
instance for validating the specified value.<U> ObjectCheck
<U, X> and
(U arg) Returns a newObjectCheck
instance for validating the specified value; supposedly another value than the one validated by this instance.<U> ObjectCheck
<U, X> Returns a newObjectCheck
instance for validating the specified value; supposedly another value than the one validated by this instance.<P> ObjectCheck
<T, X> Validates a property of the argument, retrieved through the specified function, using the specified test.<P,
O> ObjectCheck <T, X> Validates a property of the argument, retrieved through the specified function, using the specified test.<P> ObjectCheck
<T, X> Validates a property of the argument, retrieved through the specified function, using the specified test.<P> ObjectCheck
<T, X> Validates a property of the argument using the specified test.<P,
X2 extends Exception>
ObjectCheck<T, X> Validates a property of the argument, retrieved through the specified function, using the specified test.<P,
O> ObjectCheck <T, X> Validates a property of the argument, retrieved through the specified function, using the specified test.<P,
O> ObjectCheck <T, X> Validates a property of the argument using the specified test.<P,
O, X2 extends Exception>
ObjectCheck<T, X> Validates a property of the argument, retrieved through the specified function, using the specified test.has
(ToIntFunction<T> property, String name, IntPredicate test) Validates a property of the argument, retrieved through the specified function, using the specified test.<O> ObjectCheck
<T, X> has
(ToIntFunction<T> property, String name, IntObjRelation<O> test, O object) Validates a property of the argument, retrieved through the specified function, using the specified test.has
(ToIntFunction<T> property, String name, IntRelation test, int object) Validates a property of the argument, retrieved through the specified function, using the specified test.has
(ToIntFunction<T> property, IntPredicate test) Validates a property of the argument, retrieved through the specified function, using the specified test.has
(ToIntFunction<T> property, IntPredicate test, String message, Object... msgArgs) Validates a property of the argument using the specified test.<X2 extends Exception>
ObjectCheck<T, X> has
(ToIntFunction<T> property, IntPredicate test, Supplier<X2> exception) Validates a property of the argument, retrieved through the specified function, using the specified test.<O> ObjectCheck
<T, X> has
(ToIntFunction<T> property, IntObjRelation<O> test, O object) Validates a property of the argument, retrieved through the specified function, using the specified test.<O> ObjectCheck
<T, X> has
(ToIntFunction<T> property, IntObjRelation<O> test, O object, String message, Object... msgArgs) Validates the argument using the specified test.<O,
X2 extends Exception>
ObjectCheck<T, X> has
(ToIntFunction<T> property, IntObjRelation<O> test, O object, Supplier<X2> exception) Validates a property of the argument, retrieved through the specified function, using the specified test.has
(ToIntFunction<T> property, IntRelation test, int object) Validates a property of the argument, retrieved through the specified function, using the specified test.has
(ToIntFunction<T> property, IntRelation test, int object, String message, Object... msgArgs) Validates a property of the argument, retrieved through the specified function, using the specified test.<X2 extends Exception>
ObjectCheck<T, X> has
(ToIntFunction<T> property, IntRelation test, int object, Supplier<X2> exception) Validates a property of the argument, retrieved through the specified function, using the specified test.Validates the argument using the specified test.Validates the argument using the specified test.<X2 extends Exception>
ObjectCheck<T, X> Validates the argument using the specified test.<O> ObjectCheck
<T, X> Validates the argument using the specified test.<O> ObjectCheck
<T, X> Validates the argument using the specified test.<O,
X2 extends Exception>
ObjectCheck<T, X> Validates the argument using the specified test.Validates the argument using the specified test.Validates the argument using the specified test.<X2 extends Exception>
ObjectCheck<T, X> Validates the argument using the specified test.<O> ObjectCheck
<T, X> Validates the argument using the specified test.<O> ObjectCheck
<T, X> Validates the argument using the specified test.<O,
X2 extends Exception>
ObjectCheck<T, X> Validates the argument using the specified test.<P> ObjectCheck
<T, X> Validates a property of the argument, retrieved through the specified function, using the specified test.<P,
O> ObjectCheck <T, X> Validates a property of the argument, retrieved through the specified function, using the specified test.<P> ObjectCheck
<T, X> Validates a property of the argument, retrieved through the specified function, using the specified test.<P> ObjectCheck
<T, X> Validates a property of the argument using the specified test.<P,
X2 extends Exception>
ObjectCheck<T, X> Validates a property of the argument, retrieved through the specified function, using the specified test.<P,
O> ObjectCheck <T, X> Validates a property of the argument, retrieved through the specified function, using the specified test.<P,
O> ObjectCheck <T, X> Validates a property of the argument using the specified test.<P,
O, X2 extends Exception>
ObjectCheck<T, X> Validates a property of the argument, retrieved through the specified function, using the specified test.notHas
(ToIntFunction<T> property, String name, IntPredicate test) Validates a property of the argument, retrieved through the specified function, using the specified test.<O> ObjectCheck
<T, X> notHas
(ToIntFunction<T> property, String name, IntObjRelation<O> test, O object) Validates a property of the argument, retrieved through the specified function, using the specified test.notHas
(ToIntFunction<T> property, String name, IntRelation test, int object) Validates a property of the argument, retrieved through the specified function, using the specified test.notHas
(ToIntFunction<T> property, IntPredicate test) Validates a property of the argument, retrieved through the specified function, using the specified test.notHas
(ToIntFunction<T> property, IntPredicate test, String message, Object... msgArgs) Validates a property of the argument using the specified test.<X2 extends Exception>
ObjectCheck<T, X> notHas
(ToIntFunction<T> property, IntPredicate test, Supplier<X2> exception) Validates a property of the argument, retrieved through the specified function, using the specified test.<O> ObjectCheck
<T, X> notHas
(ToIntFunction<T> property, IntObjRelation<O> test, O object) Validates a property of the argument, retrieved through the specified function, using the specified test.<O> ObjectCheck
<T, X> notHas
(ToIntFunction<T> property, IntObjRelation<O> test, O object, String message, Object... msgArgs) Validates a property of the argument using the specified test.<O,
X2 extends Exception>
ObjectCheck<T, X> notHas
(ToIntFunction<T> property, IntObjRelation<O> test, O object, Supplier<X2> exception) Validates a property of the argument, retrieved through the specified function, using the specified test.notHas
(ToIntFunction<T> property, IntRelation test, int object) Validates a property of the argument, retrieved through the specified function, using the specified test.notHas
(ToIntFunction<T> property, IntRelation test, int object, String message, Object... msgArgs) Validates a property of the argument using the specified test.<X2 extends Exception>
ObjectCheck<T, X> notHas
(ToIntFunction<T> property, IntRelation test, int object, Supplier<X2> exception) Validates a property of the argument, retrieved through the specified function, using the specified test.ok()
Returns the validated value.<R,
X2 extends Throwable>
Rok
(FallibleFunction<T, R, X2> transformer) Passes the validated value to the specified function and returns the value it computes.<X2 extends Throwable>
voidthen
(FallibleConsumer<T, X2> consumer) Passes the validated value to a consumer for further processing.
-
Method Details
-
ok
Returns the validated value. To be used as the last call after a chain of checks.- Returns:
- the value validated by this instance
-
ok
Passes the validated value to the specified function and returns the value it computes. To be used as the last call after a chain of checks. For example:int age = Check.that(person).has(Person::getAge, "age", lt(), 50).ok(Person::getAge);
- Type Parameters:
R
- the type of the returned valueX2
- the type of the exception thrown if the transformation fails- Parameters:
transformer
- a function that transforms the value validated by this instance- Returns:
- the value computed by the transformation function
- Throws:
X2
- if the transformation fails
-
then
Passes the validated value to a consumer for further processing. To be used as the last call after a chain of checks.- Type Parameters:
X2
- the type of the exception thrown if the consumer fails while processing the value- Parameters:
consumer
- a consumer of the value validated by this instance- Throws:
X2
- if the consumer fails while processing the value
-
is
Validates the argument using the specified test. While not strictly required, this method is meant to be used with a check from theCommonChecks
class so that an informative error message is generated if the argument turns out to be invalid.- Parameters:
test
- the test- Returns:
- this instance
- Throws:
X
- if the argument is invalid
-
isNot
Validates the argument using the specified test. While not strictly required, this method is meant to be used with a check from theCommonChecks
class so that an informative error message is generated if the argument turns out to be invalid.- Parameters:
test
- the test- Returns:
- this instance
- Throws:
X
- if the argument is invalid
-
is
Validates the argument using the specified test. Allows you to provide a custom error message. See the paragraph on Custom Error Messages in the module description for how to specify a custom message.- Parameters:
test
- the testmessage
- the message patternmsgArgs
- the message arguments- Returns:
- this instance
- Throws:
X
- if the argument is invalid
-
isNot
Validates the argument using the specified test. Allows you to provide a custom error message. See the paragraph on Custom Error Messages in the module description for how to specify a custom message.- Parameters:
test
- the testmessage
- the message patternmsgArgs
- the message arguments- Returns:
- this instance
- Throws:
X
- if the argument is invalid
-
is
public <X2 extends Exception> ObjectCheck<T,X> is(Predicate<T> test, Supplier<X2> exception) throws X2 Validates the argument using the specified test. Allows you to throw a different type of exception for this particular test.- Type Parameters:
X2
- the type of the exception thrown if the argument is invalid- Parameters:
test
- the testexception
- the supplier of the exception to be thrown if the argument is invalid- Returns:
- this instance
- Throws:
X2
- if the argument is invalid
-
isNot
public <X2 extends Exception> ObjectCheck<T,X> isNot(Predicate<T> test, Supplier<X2> exception) throws X2 Validates the argument using the specified test. Allows you to throw a different type of exception for this particular test.- Type Parameters:
X2
- the type of the exception thrown if the argument is invalid- Parameters:
test
- the testexception
- the supplier of the exception to be thrown if the argument is invalid- Returns:
- this instance
- Throws:
X2
- if the argument is invalid
-
is
Validates the argument using the specified test. While not strictly required, this method is meant to be used in combination with a check from theCommonChecks
class so that an informative error message is generated if the argument turns out to be invalid.- Type Parameters:
O
- the type of the value being tested against- Parameters:
test
- the testobject
- the value that the argument is tested against (called "the object" of a relation)- Returns:
- this instance
- Throws:
X
- if the argument is invalid
-
isNot
Validates the argument using the specified test. While not strictly required, this method is meant to be used in combination with a check from theCommonChecks
class so that an informative error message is generated if the argument turns out to be invalid.- Type Parameters:
O
- the type of the value being tested against- Parameters:
test
- the testobject
- the value that the argument is tested against (called "the object" of a relation)- Returns:
- this instance
- Throws:
X
- if the argument is invalid
-
is
public <O> ObjectCheck<T,X> is(Relation<T, O> test, O object, String message, Object... msgArgs) throws XValidates the argument using the specified test. Allows you to provide a custom error message. See the paragraph on Custom Error Messages in the module description for how to specify a custom message.- Type Parameters:
O
- the type of the value being tested against- Parameters:
test
- the testobject
- the value that the argument is tested against (called "the object" of a relation)message
- the message patternmsgArgs
- the message arguments- Returns:
- this instance
- Throws:
X
- if the argument is invalid
-
isNot
public <O> ObjectCheck<T,X> isNot(Relation<T, O> test, O object, String message, Object... msgArgs) throws XValidates the argument using the specified test. Allows you to provide a custom error message. See the paragraph on Custom Error Messages in the module description for how to specify a custom message.- Type Parameters:
O
- the type of the value being tested against- Parameters:
test
- the testobject
- the value that the argument is tested against (called "the object" of a relation)message
- the message patternmsgArgs
- the message arguments- Returns:
- this instance
- Throws:
X
- if the argument is invalid
-
is
public <O,X2 extends Exception> ObjectCheck<T,X> is(Relation<T, O> test, O object, Supplier<X2> exception) throws X2Validates the argument using the specified test. Allows you to throw a different type of exception for this particular test.- Type Parameters:
O
- the type of the value being tested againstX2
- the type of the exception thrown if the argument is invalid- Parameters:
test
- the testobject
- the value that the argument is tested against (called "the object" of a relation)exception
- the supplier of the exception to be thrown if the argument is invalid- Returns:
- this instance
- Throws:
X2
- if the argument is invalid
-
isNot
public <O,X2 extends Exception> ObjectCheck<T,X> isNot(Relation<T, O> test, O object, Supplier<X2> exception) throws X2Validates the argument using the specified test. Allows you to throw a different type of exception for this particular test.- Type Parameters:
O
- the type of the value being tested againstX2
- the type of the exception thrown if the argument is invalid- Parameters:
test
- the testobject
- the value that the argument is tested against (called "the object" of a relation)exception
- the supplier of the exception to be thrown if the argument is invalid- Returns:
- this instance
- Throws:
X2
- if the argument is invalid
-
has
Validates a property of the argument, retrieved through the specified function, using the specified test. While not strictly required, this method is meant to be used in combination with a check from theCommonChecks
class and a "property" from theCommonProperties
class so that an informative error message is generated if the argument turns out to be invalid.- Type Parameters:
P
- the type of the extracted value- Parameters:
property
- a function that transforms the value validated by thisObjectCheck
into another value, which is to be validated using the specified test. This would typically be a function that extracts a bean property from a JavaBeantest
- the test- Returns:
- this instance
- Throws:
X
- if the argument is invalid
-
notHas
Validates a property of the argument, retrieved through the specified function, using the specified test. While not strictly required, this method is meant to be used in combination with a check from theCommonChecks
class and a "property" from theCommonProperties
class so that an informative error message is generated if the argument turns out to be invalid.- Type Parameters:
P
- the type of the extracted value- Parameters:
property
- a function that transforms the value validated by thisObjectCheck
into another value, which is to be validated using the specified test. This would typically be a function that extracts a bean property from a JavaBeantest
- the test- Returns:
- this instance
- Throws:
X
- if the argument is invalid
-
has
Validates a property of the argument, retrieved through the specified function, using the specified test. While not strictly required, this method is meant to be used in combination with a check from theCommonChecks
class so that an informative error message is generated if the argument turns out to be invalid.- Type Parameters:
P
- the type of the extracted value- Parameters:
property
- a function that transforms the value validated by thisObjectCheck
into another value, which is to be validated using the specified test. This would typically be a function that extracts a bean property from a JavaBeanname
- the name of the property being tested. In error messages the fully-qualified name will be used and constructed usingargName + "." + name
.test
- the test- Returns:
- this instance
- Throws:
X
- if the argument is invalid
-
notHas
Validates a property of the argument, retrieved through the specified function, using the specified test. While not strictly required, this method is meant to be used in combination with a check from theCommonChecks
class so that an informative error message is generated if the argument turns out to be invalid.- Type Parameters:
P
- the type of the extracted value- Parameters:
property
- a function that transforms the value validated by thisObjectCheck
into another value, which is to be validated using the specified test. This would typically be a function that extracts a bean property from a JavaBeanname
- the name of the property being testedtest
- the test- Returns:
- this instance
- Throws:
X
- if the argument is invalid
-
has
public <P> ObjectCheck<T,X> has(Function<T, P> property, Predicate<P> test, String message, Object... msgArgs) throws XValidates a property of the argument using the specified test. Allows you to provide a custom error message. See the paragraph on Custom Error Messages in the module description for how to specify a custom message.- Type Parameters:
P
- the type of the extracted value- Parameters:
property
- a function that transforms the value validated by thisObjectCheck
into another value, which is to be validated using the specified test. This would typically be a function that extracts a bean property from a JavaBeantest
- the testmessage
- the message patternmsgArgs
- the message arguments- Returns:
- this instance
- Throws:
X
- if the argument is invalid
-
notHas
public <P> ObjectCheck<T,X> notHas(Function<T, P> property, Predicate<P> test, String message, Object... msgArgs) throws XValidates a property of the argument using the specified test. Allows you to provide a custom error message. See the paragraph on Custom Error Messages in the module description for how to specify a custom message.- Type Parameters:
P
- the type of the extracted value- Parameters:
property
- a function that transforms the value validated by thisObjectCheck
into another value, which is to be validated using the specified test. This would typically be a function that extracts a bean property from a JavaBeantest
- the testmessage
- the message patternmsgArgs
- the message arguments- Returns:
- this instance
- Throws:
X
- if the argument is invalid
-
has
public <P,X2 extends Exception> ObjectCheck<T,X> has(Function<T, P> property, Predicate<P> test, Supplier<X2> exception) throws X2Validates a property of the argument, retrieved through the specified function, using the specified test. Allows you to throw a different type of exception for this particular test.- Type Parameters:
P
- the type of the extracted valueX2
- the type of the exception thrown if the argument is invalid- Parameters:
property
- a function that transforms the value validated by thisObjectCheck
into another value, which is to be validated using the specified test. This would typically be a function that extracts a bean property from a JavaBeantest
- the testexception
- the supplier of the exception to be thrown if the argument is invalid- Returns:
- this instance
- Throws:
X2
- if the argument is invalid
-
notHas
public <P,X2 extends Exception> ObjectCheck<T,X> notHas(Function<T, P> property, Predicate<P> test, Supplier<X2> exception) throws X2Validates a property of the argument, retrieved through the specified function, using the specified test. Allows you to throw a different type of exception for this particular test.- Type Parameters:
P
- the type of the extracted valueX2
- the type of the exception thrown if the argument is invalid- Parameters:
property
- a function that transforms the value validated by thisObjectCheck
into another value, which is to be validated using the specified test. This would typically be a function that extracts a bean property from a JavaBeantest
- the testexception
- the supplier of the exception to be thrown if the argument is invalid- Returns:
- this instance
- Throws:
X2
- if the argument is invalid
-
has
Validates a property of the argument, retrieved through the specified function, using the specified test. While not strictly required, this method is meant to be used in combination with a check from theCommonChecks
class and a "property" from theCommonProperties
class so that an informative error message is generated if the argument turns out to be invalid.- Type Parameters:
P
- the type of the extracted valueO
- the type of the value being tested against- Parameters:
property
- a function that transforms the value validated by thisObjectCheck
into another value, which is to be validated using the specified test. This would typically be a function that extracts a bean property from a JavaBeantest
- the testobject
- the value that the argument is tested against (called "the object" of a relation)- Returns:
- this instance
- Throws:
X
- if the argument is invalid
-
notHas
public <P,O> ObjectCheck<T,X> notHas(Function<T, P> property, Relation<P, throws XO> test, O object) Validates a property of the argument, retrieved through the specified function, using the specified test. While not strictly required, this method is meant to be used in combination with a check from theCommonChecks
class and a "property" from theCommonProperties
class so that an informative error message is generated if the argument turns out to be invalid.- Type Parameters:
P
- the type of the extracted valueO
- the type of the value being tested against- Parameters:
property
- a function that transforms the value validated by thisObjectCheck
into another value, which is to be validated using the specified test. This would typically be a function that extracts a bean property from a JavaBeantest
- the testobject
- the value that the argument is tested against (called "the object" of a relation)- Returns:
- this instance
- Throws:
X
- if the argument is invalid
-
has
public <P,O> ObjectCheck<T,X> has(Function<T, P> property, String name, Relation<P, throws XO> test, O object) Validates a property of the argument, retrieved through the specified function, using the specified test. While not strictly required, this method is meant to be used in combination with a check from theCommonChecks
class so that an informative error message is generated if the argument turns out to be invalid.- Type Parameters:
P
- the type of the extracted valueO
- the type of the value being tested against- Parameters:
property
- a function that transforms the value validated by thisObjectCheck
into another value, which is to be validated using the specified test. This would typically be a function that extracts a bean property from a JavaBeanname
- the name of the property being tested.test
- the testobject
- the value that the argument is tested against (called "the object" of a relation)- Returns:
- this instance
- Throws:
X
- if the argument is invalid
-
notHas
public <P,O> ObjectCheck<T,X> notHas(Function<T, P> property, String name, Relation<P, throws XO> test, O object) Validates a property of the argument, retrieved through the specified function, using the specified test. While not strictly required, this method is meant to be used in combination with a check from theCommonChecks
class so that an informative error message is generated if the argument turns out to be invalid.- Type Parameters:
P
- the type of the extracted valueO
- the type of the value being tested against- Parameters:
property
- a function that transforms the value validated by thisObjectCheck
into another value, which is to be validated using the specified test. This would typically be a function that extracts a bean property from a JavaBeanname
- the name of the property being tested. In error messages the fully-qualified name will be used and constructed usingargName + "." + name
.test
- the testobject
- the value that the argument is tested against (called "the object" of a relation)- Returns:
- this instance
- Throws:
X
- if the argument is invalid
-
has
public <P,O> ObjectCheck<T,X> has(Function<T, P> property, Relation<P, throws XO> test, O object, String message, Object... msgArgs) Validates a property of the argument using the specified test. Allows you to provide a custom error message. See the paragraph on Custom Error Messages in the module description for how to specify a custom message.- Type Parameters:
P
- the type of the extracted valueO
- the type of the value being tested against- Parameters:
property
- a function that transforms the value validated by thisObjectCheck
into another value, which is to be validated using the specified test. This would typically be a function that extracts a bean property from a JavaBeantest
- the testobject
- the value that the argument is tested against (called "the object" of a relation)message
- the message patternmsgArgs
- the message arguments- Returns:
- this instance
- Throws:
X
- if the argument is invalid
-
notHas
public <P,O> ObjectCheck<T,X> notHas(Function<T, P> property, Relation<P, throws XO> test, O object, String message, Object... msgArgs) Validates a property of the argument using the specified test. Allows you to provide a custom error message. See the paragraph on Custom Error Messages in the module description for how to specify a custom message.- Type Parameters:
P
- the type of the extracted valueO
- the type of the value being tested against- Parameters:
property
- a function that transforms the value validated by thisObjectCheck
into another value, which is to be validated using the specified test. This would typically be a function that extracts a bean property from a JavaBeantest
- the testobject
- the value that the argument is tested against (called "the object" of a relation)message
- the message patternmsgArgs
- the message arguments- Returns:
- this instance
- Throws:
X
- if the argument is invalid
-
has
public <P,O, ObjectCheck<T,X2 extends Exception> X> has(Function<T, P> property, Relation<P, throws X2O> test, O object, Supplier<X2> exception) Validates a property of the argument, retrieved through the specified function, using the specified test. Allows you to throw a different type of exception for this particular test.- Type Parameters:
P
- the type of the extracted valueO
- the type of the value being tested againstX2
- the type of the exception thrown if the argument is invalid- Parameters:
property
- a function that transforms the value validated by thisObjectCheck
into another value, which is to be validated using the specified test. This would typically be a function that extracts a bean property from a JavaBeantest
- the testobject
- the value that the argument is tested against (called "the object" of a relation)exception
- the supplier of the exception to be thrown if the argument is invalid- Returns:
- this instance
- Throws:
X2
- if the argument is invalid
-
notHas
public <P,O, ObjectCheck<T,X2 extends Exception> X> notHas(Function<T, P> property, Relation<P, throws X2O> test, O object, Supplier<X2> exception) Validates a property of the argument, retrieved through the specified function, using the specified test. Allows you to throw a different type of exception for this particular test.- Type Parameters:
P
- the type of the extracted valueO
- the type of the value being tested againstX2
- the type of the exception thrown if the argument is invalid- Parameters:
property
- a function that transforms the value validated by thisObjectCheck
into another value, which is to be validated using the specified test. This would typically be a function that extracts a bean property from a JavaBeantest
- the testobject
- the value that the argument is tested against (called "the object" of a relation)exception
- the supplier of the exception to be thrown if the argument is invalid- Returns:
- this instance
- Throws:
X2
- if the argument is invalid
-
has
Validates a property of the argument, retrieved through the specified function, using the specified test. While not strictly required, this method is meant to be used in combination with a check from theCommonChecks
class and a "property" from theCommonProperties
class so that an informative error message is generated if the argument turns out to be invalid.- Parameters:
property
- a function that transforms the value validated by thisObjectCheck
into another value, which is to be validated using the specified test. This would typically be a function that extracts a bean property from a JavaBeantest
- the test- Returns:
- this instance
- Throws:
X
- if the argument is invalid
-
notHas
Validates a property of the argument, retrieved through the specified function, using the specified test. While not strictly required, this method is meant to be used in combination with a check from theCommonChecks
class and a "property" from theCommonProperties
class so that an informative error message is generated if the argument turns out to be invalid.- Parameters:
property
- a function that transforms the value validated by thisObjectCheck
into another value, which is to be validated using the specified test. This would typically be a function that extracts a bean property from a JavaBeantest
- the test- Returns:
- this instance
- Throws:
X
- if the argument is invalid
-
has
Validates a property of the argument, retrieved through the specified function, using the specified test. While not strictly required, this method is meant to be used in combination with a check from theCommonChecks
class so that an informative error message is generated if the argument turns out to be invalid.- Parameters:
property
- a function that transforms the value validated by thisObjectCheck
into another value, which is to be validated using the specified test. This would typically be a function that extracts a bean property from a JavaBeanname
- the name of the property being tested.test
- the test- Returns:
- this instance
- Throws:
X
- if the argument is invalid
-
notHas
Validates a property of the argument, retrieved through the specified function, using the specified test. While not strictly required, this method is meant to be used in combination with a check from theCommonChecks
class so that an informative error message is generated if the argument turns out to be invalid.- Parameters:
property
- a function that transforms the value validated by thisObjectCheck
into another value, which is to be validated using the specified test. This would typically be a function that extracts a bean property from a JavaBeanname
- the name of the property being tested.test
- the test- Returns:
- this instance
- Throws:
X
- if the argument is invalid
-
has
public ObjectCheck<T,X> has(ToIntFunction<T> property, IntPredicate test, String message, Object... msgArgs) throws X Validates a property of the argument using the specified test. Allows you to provide a custom error message. See the paragraph on Custom Error Messages in the module description for how to specify a custom message.- Parameters:
property
- a function that transforms the value validated by thisObjectCheck
into another value, which is to be validated using the specified test. This would typically be a function that extracts a bean property from a JavaBeantest
- the testmessage
- the message patternmsgArgs
- the message arguments- Returns:
- this instance
- Throws:
X
- if the argument is invalid
-
notHas
public ObjectCheck<T,X> notHas(ToIntFunction<T> property, IntPredicate test, String message, Object... msgArgs) throws X Validates a property of the argument using the specified test. Allows you to provide a custom error message. See the paragraph on Custom Error Messages in the module description for how to specify a custom message.- Parameters:
property
- a function that transforms the value validated by thisObjectCheck
into another value, which is to be validated using the specified test. This would typically be a function that extracts a bean property from a JavaBeantest
- the testmessage
- the message patternmsgArgs
- the message arguments- Returns:
- this instance
- Throws:
X
- if the argument is invalid
-
has
public <X2 extends Exception> ObjectCheck<T,X> has(ToIntFunction<T> property, IntPredicate test, Supplier<X2> exception) throws X2 Validates a property of the argument, retrieved through the specified function, using the specified test. Allows you to throw a different type of exception for this particular test.- Type Parameters:
X2
- the type of the exception thrown if the argument is invalid- Parameters:
property
- a function that transforms the value validated by thisObjectCheck
into another value, which is to be validated using the specified test. This would typically be a function that extracts a bean property from a JavaBeantest
- the testexception
- the supplier of the exception to be thrown if the argument is invalid- Returns:
- this instance
- Throws:
X2
- if the argument is invalid
-
notHas
public <X2 extends Exception> ObjectCheck<T,X> notHas(ToIntFunction<T> property, IntPredicate test, Supplier<X2> exception) throws X2 Validates a property of the argument, retrieved through the specified function, using the specified test. Allows you to throw a different type of exception for this particular test.- Type Parameters:
X2
- the type of the exception thrown if the argument is invalid- Parameters:
property
- a function that transforms the value validated by thisObjectCheck
into another value, which is to be validated using the specified test. This would typically be a function that extracts a bean property from a JavaBeantest
- the testexception
- the supplier of the exception to be thrown if the argument is invalid- Returns:
- this instance
- Throws:
X2
- if the argument is invalid
-
has
public <O> ObjectCheck<T,X> has(ToIntFunction<T> property, IntObjRelation<O> test, O object) throws X Validates a property of the argument, retrieved through the specified function, using the specified test. While not strictly required, this method is meant to be used in combination with a check from theCommonChecks
class and a "property" from theCommonProperties
class so that an informative error message is generated if the argument turns out to be invalid.Note that this method is heavily overloaded. Therefore you need to pay attention when providing a lambda or method reference for both the
property
argument and thetest
argument. Plain lambdas or method references may cause the compiler to complain about an Ambiguous method call. If so, see the package description for what you need to do.- Type Parameters:
O
- the type of the value being tested against- Parameters:
property
- a function that transforms the value validated by thisObjectCheck
into another value, which is to be validated using the specified test. This would typically be a function that extracts a bean property from a JavaBeantest
- the testobject
- the value that the argument is tested against (called "the object" of a relation)- Returns:
- this instance
- Throws:
X
- if the argument is invalid
-
notHas
public <O> ObjectCheck<T,X> notHas(ToIntFunction<T> property, IntObjRelation<O> test, O object) throws X Validates a property of the argument, retrieved through the specified function, using the specified test. While not strictly required, this method is meant to be used in combination with a check from theCommonChecks
class and a "property" from theCommonProperties
class so that an informative error message is generated if the argument turns out to be invalid.Note that this method is heavily overloaded. Therefore you need to pay attention when providing a lambda or method reference for both the
property
argument and thetest
argument. Plain lambdas or method references may cause the compiler to complain about an Ambiguous method call. If so, see the package description for what you need to do.- Type Parameters:
O
- the type of the value being tested against- Parameters:
property
- a function that transforms the value validated by thisObjectCheck
into another value, which is to be validated using the specified test. This would typically be a function that extracts a bean property from a JavaBeantest
- the testobject
- the value that the argument is tested against (called "the object" of a relation)- Returns:
- this instance
- Throws:
X
- if the argument is invalid
-
has
public <O> ObjectCheck<T,X> has(ToIntFunction<T> property, String name, IntObjRelation<O> test, O object) throws X Validates a property of the argument, retrieved through the specified function, using the specified test. While not strictly required, this method is meant to be used in combination with a check from theCommonChecks
class so that an informative error message is generated if the argument turns out to be invalid.Note that this method is heavily overloaded. Therefore you need to pay attention when providing a lambda or method reference for both the
property
argument and thetest
argument. Plain lambdas or method references may cause the compiler to complain about an Ambiguous method call. If so, see the package description for what you need to do.- Type Parameters:
O
- the type of the value being tested against- Parameters:
property
- a function that transforms the value validated by thisObjectCheck
into another value, which is to be validated using the specified test. This would typically be a function that extracts a bean property from a JavaBeanname
- the name of the property being tested. In error messages the fully-qualified name will be used and constructed usingargName + "." + name
.test
- the testobject
- the value that the argument is tested against (called "the object" of a relation)- Returns:
- this instance
- Throws:
X
- if the argument is invalid
-
notHas
public <O> ObjectCheck<T,X> notHas(ToIntFunction<T> property, String name, IntObjRelation<O> test, O object) throws X Validates a property of the argument, retrieved through the specified function, using the specified test. While not strictly required, this method is meant to be used in combination with a check from theCommonChecks
class so that an informative error message is generated if the argument turns out to be invalid.Note that this method is heavily overloaded. Therefore you need to pay attention when providing a lambda or method reference for both the
property
argument and thetest
argument. Plain lambdas or method references may cause the compiler to complain about an Ambiguous method call. If so, see the package description for what you need to do.- Type Parameters:
O
- the type of the value being tested against- Parameters:
property
- a function that transforms the value validated by thisObjectCheck
into another value, which is to be validated using the specified test. This would typically be a function that extracts a bean property from a JavaBeanname
- the name of the property being tested. In error messages the fully-qualified name will be used and constructed usingargName + "." + name
.test
- the testobject
- the value that the argument is tested against (called "the object" of a relation)- Returns:
- this instance
- Throws:
X
- if the argument is invalid
-
has
public <O> ObjectCheck<T,X> has(ToIntFunction<T> property, IntObjRelation<O> test, O object, String message, Object... msgArgs) throws X Validates the argument using the specified test. Allows you to provide a custom error message. See the paragraph on Custom Error Messages in the module description for how to specify a custom message.Note that this method is heavily overloaded. Therefore you need to pay attention when providing a lambda or method reference for both the
property
argument and thetest
argument. Plain lambdas or method references may cause the compiler to complain about an Ambiguous method call. If so, see the package description for what you need to do.- Type Parameters:
O
- the type of the value being tested against- Parameters:
property
- a function that transforms the value validated by thisObjectCheck
into another value, which is to be validated using the specified test. This would typically be a function that extracts a bean property from a JavaBeantest
- the testobject
- the value that the argument is tested against (called "the object" of a relation)message
- the message patternmsgArgs
- the message arguments- Returns:
- this instance
- Throws:
X
- if the argument is invalid
-
notHas
public <O> ObjectCheck<T,X> notHas(ToIntFunction<T> property, IntObjRelation<O> test, O object, String message, Object... msgArgs) throws X Validates a property of the argument using the specified test. Allows you to provide a custom error message. See the paragraph on Custom Error Messages in the module description for how to specify a custom message.Note that this method is heavily overloaded. Therefore you need to pay attention when providing a lambda or method reference for both the
property
argument and thetest
argument. Plain lambdas or method references may cause the compiler to complain about an Ambiguous method call. If so, see the package description for what you need to do.- Type Parameters:
O
- the type of the value being tested against- Parameters:
property
- a function that transforms the value validated by thisObjectCheck
into another value, which is to be validated using the specified test. This would typically be a function that extracts a bean property from a JavaBeantest
- the testobject
- the value that the argument is tested against (called "the object" of a relation)message
- the message patternmsgArgs
- the message arguments- Returns:
- this instance
- Throws:
X
- if the argument is invalid
-
has
public <O,X2 extends Exception> ObjectCheck<T,X> has(ToIntFunction<T> property, IntObjRelation<O> test, O object, Supplier<X2> exception) throws X2 Validates a property of the argument, retrieved through the specified function, using the specified test. Allows you to throw a different type of exception for this particular test.- Type Parameters:
O
- the type of the value being tested againstX2
- the type of the exception thrown if the argument is invalid- Parameters:
property
- a function that transforms the value validated by thisObjectCheck
into another value, which is to be validated using the specified test. This would typically be a function that extracts a bean property from a JavaBeantest
- the testobject
- the value that the argument is tested against (called "the object" of a relation)exception
- the supplier of the exception to be thrown if the argument is invalid- Returns:
- this instance
- Throws:
X2
- if the argument is invalid
-
notHas
public <O,X2 extends Exception> ObjectCheck<T,X> notHas(ToIntFunction<T> property, IntObjRelation<O> test, O object, Supplier<X2> exception) throws X2 Validates a property of the argument, retrieved through the specified function, using the specified test. Allows you to throw a different type of exception for this particular test.Note that this method is heavily overloaded. Therefore you need to pay attention when providing a lambda or method reference for both the
property
argument and thetest
argument. Plain lambdas or method references may cause the compiler to complain about an Ambiguous method call. If so, see the package description for what you need to do.- Type Parameters:
O
- the type of the value being tested againstX2
- the type of the exception thrown if the argument is invalid- Parameters:
property
- a function that transforms the value validated by thisObjectCheck
into another value, which is to be validated using the specified test. This would typically be a function that extracts a bean property from a JavaBeantest
- the testobject
- the value that the argument is tested against (called "the object" of a relation)exception
- the supplier of the exception to be thrown if the argument is invalid- Returns:
- this instance
- Throws:
X2
- if the argument is invalid
-
has
Validates a property of the argument, retrieved through the specified function, using the specified test. While not strictly required, this method is meant to be used in combination with a check from theCommonChecks
class and a "property" from theCommonProperties
class so that an informative error message is generated if the argument turns out to be invalid.Note that this method is heavily overloaded. Therefore you need to pay attention when providing a lambda or method reference for both the
property
argument and thetest
argument. Plain lambdas or method references may cause the compiler to complain about an Ambiguous method call. If so, see the package description for what you need to do.- Parameters:
property
- a function that transforms the value validated by thisObjectCheck
into another value, which is to be validated using the specified test. This would typically be a function that extracts a bean property from a JavaBeantest
- the testobject
- the value that the argument is tested against (called "the object" of a relation)- Returns:
- this instance
- Throws:
X
- if the argument is invalid
-
notHas
Validates a property of the argument, retrieved through the specified function, using the specified test. While not strictly required, this method is meant to be used in combination with a check from theCommonChecks
class and a "property" from theCommonProperties
class so that an informative error message is generated if the argument turns out to be invalid.Note that this method is heavily overloaded. Therefore you need to pay attention when providing a lambda or method reference for both the
property
argument and thetest
argument. Plain lambdas or method references may cause the compiler to complain about an Ambiguous method call. If so, see the package description for what you need to do.- Parameters:
property
- a function that transforms the value validated by thisObjectCheck
into another value, which is to be validated using the specified test. This would typically be a function that extracts a bean property from a JavaBeantest
- the testobject
- the value that the argument is tested against (called "the object" of a relation)- Returns:
- this instance
- Throws:
X
- if the argument is invalid
-
has
public ObjectCheck<T,X> has(ToIntFunction<T> property, String name, IntRelation test, int object) throws X Validates a property of the argument, retrieved through the specified function, using the specified test. While not strictly required, this method is meant to be used in combination with a check from theCommonChecks
class so that an informative error message is generated if the argument turns out to be invalid.Note that this method is heavily overloaded. Therefore you need to pay attention when providing a lambda or method reference for both the
property
argument and thetest
argument. Plain lambdas or method references may cause the compiler to complain about an Ambiguous method call. If so, see the package description for what you need to do.- Parameters:
property
- a function that transforms the value validated by thisObjectCheck
into another value, which is to be validated using the specified test. This would typically be a function that extracts a bean property from a JavaBeanname
- the name of the property being tested. In error messages the fully-qualified name will be used and constructed usingargName + "." + name
.test
- the testobject
- the value that the argument is tested against (called "the object" of a relation)- Returns:
- this instance
- Throws:
X
- if the argument is invalid
-
notHas
public ObjectCheck<T,X> notHas(ToIntFunction<T> property, String name, IntRelation test, int object) throws X Validates a property of the argument, retrieved through the specified function, using the specified test. While not strictly required, this method is meant to be used in combination with a check from theCommonChecks
class so that an informative error message is generated if the argument turns out to be invalid.Note that this method is heavily overloaded. Therefore you need to pay attention when providing a lambda or method reference for both the
property
argument and thetest
argument. Plain lambdas or method references may cause the compiler to complain about an Ambiguous method call. If so, see the package description for what you need to do.- Parameters:
property
- a function that transforms the value validated by thisObjectCheck
into another value, which is to be validated using the specified test. This would typically be a function that extracts a bean property from a JavaBeanname
- the name of the property being tested. In error messages the fully-qualified name will be used and constructed usingargName + "." + name
.test
- the testobject
- the value that the argument is tested against (called "the object" of a relation)- Returns:
- this instance
- Throws:
X
- if the argument is invalid
-
has
public ObjectCheck<T,X> has(ToIntFunction<T> property, IntRelation test, int object, String message, Object... msgArgs) throws X Validates a property of the argument, retrieved through the specified function, using the specified test. Allows you to provide a custom error message. See thepackage description
for how to specify a custom error message.Note that this method is heavily overloaded. Therefore you need to pay attention when providing a lambda or method reference for both the
property
argument and thetest
argument. Plain lambdas or method references may cause the compiler to complain about an Ambiguous method call. If so, see the package description for what you need to do.- Parameters:
property
- a function that transforms the value validated by thisObjectCheck
into another value, which is to be validated using the specified test. This would typically be a function that extracts a bean property from a JavaBeantest
- the testobject
- the value that the argument is tested against (called "the object" of a relation)message
- the message patternmsgArgs
- the message arguments- Returns:
- this instance
- Throws:
X
- if the argument is invalid
-
notHas
public ObjectCheck<T,X> notHas(ToIntFunction<T> property, IntRelation test, int object, String message, Object... msgArgs) throws X Validates a property of the argument using the specified test. Allows you to provide a custom error message. See the paragraph on Custom Error Messages in the module description for how to specify a custom message.Note that this method is heavily overloaded. Therefore you need to pay attention when providing a lambda or method reference for both the
property
argument and thetest
argument. Plain lambdas or method references may cause the compiler to complain about an Ambiguous method call. If so, see the package description for what you need to do.- Parameters:
property
- a function that transforms the value validated by thisObjectCheck
into another value, which is to be validated using the specified test. This would typically be a function that extracts a bean property from a JavaBeantest
- the testobject
- the value that the argument is tested against (called "the object" of a relation)message
- the message patternmsgArgs
- the message arguments- Returns:
- this instance
- Throws:
X
- if the argument is invalid
-
has
public <X2 extends Exception> ObjectCheck<T,X> has(ToIntFunction<T> property, IntRelation test, int object, Supplier<X2> exception) throws X2 Validates a property of the argument, retrieved through the specified function, using the specified test. Allows you to throw a different type of exception for this particular test.Note that this method is heavily overloaded. Therefore you need to pay attention when providing a lambda or method reference for both the
property
argument and thetest
argument. Plain lambdas or method references may cause the compiler to complain about an Ambiguous method call. If so, see the package description for what you need to do.- Type Parameters:
X2
- the type of the exception thrown if the argument is invalid- Parameters:
property
- a function that transforms the value validated by thisObjectCheck
into another value, which is to be validated using the specified test. This would typically be a function that extracts a bean property from a JavaBeantest
- the testobject
- the value that the argument is tested against (called "the object" of a relation)exception
- the supplier of the exception to be thrown if the argument is invalid- Returns:
- this instance
- Throws:
X2
- if the argument is invalid
-
notHas
public <X2 extends Exception> ObjectCheck<T,X> notHas(ToIntFunction<T> property, IntRelation test, int object, Supplier<X2> exception) throws X2 Validates a property of the argument, retrieved through the specified function, using the specified test. Allows you to throw a different type of exception for this particular test.Note that this method is heavily overloaded. Therefore you need to pay attention when providing a lambda or method reference for both the
property
argument and thetest
argument. Plain lambdas or method references may cause the compiler to complain about an Ambiguous method call. If so, see the package description for what you need to do.- Type Parameters:
X2
- the type of the exception thrown if the argument is invalid- Parameters:
property
- a function that transforms the value validated by thisObjectCheck
into another value, which is to be validated using the specified test. This would typically be a function that extracts a bean property from a JavaBeantest
- the testobject
- the value that the argument is tested against (called "the object" of a relation)exception
- the supplier of the exception to be thrown if the argument is invalid- Returns:
- this instance
- Throws:
X2
- if the argument is invalid
-
and
Returns anIntCheck
instance for validating the specified value. The new instance inherits the exception factory of this instance.- Parameters:
arg
- the value to be validated.- Returns:
- a new
IntCheck
instance for validating the specified value
-
and
Returns anIntCheck
instance for validating the specified value. The new instance inherits the exception factory of this instance.- Parameters:
arg
- the value to be validated.argName
- the name of the argument, field or variable being validated- Returns:
- a new
IntCheck
instance for validating the specified value
-
and
Returns a newObjectCheck
instance for validating the specified value; supposedly another value than the one validated by this instance. The new instance inherits the exception factory of this instance.- Type Parameters:
U
- the type of the value- Parameters:
arg
- the value to be validated.- Returns:
- a new
ObjectCheck
instance for validating the specified value
-
and
Returns a newObjectCheck
instance for validating the specified value; supposedly another value than the one validated by this instance. The new instance inherits the exception factory of this instance.- Type Parameters:
U
- the type of the value- Parameters:
arg
- the value to be validated.argName
- the name of the argument, field or variable being validated- Returns:
- a new
ObjectCheck
instance for validating the specified value
-