Interface JavaRequireThat
- All Known Subinterfaces:
JavaValidators
-
Method Summary
Modifier and TypeMethodDescriptionrequireThat
(boolean[] value, String name) Validates the state of a primitiveboolean
array.requireThat
(boolean value, String name) Validates the state of aboolean
.requireThat
(byte[] value, String name) Validates the state of a primitivebyte
array.requireThat
(byte value, String name) Validates the state of abyte
.requireThat
(char[] value, String name) Validates the state of a primitivechar
array.requireThat
(char value, String name) Validates the state of achar
.requireThat
(double[] value, String name) Validates the state of a primitivedouble
array.requireThat
(double value, String name) Validates the state of adouble
.requireThat
(float[] value, String name) Validates the state of a primitivefloat
array.requireThat
(float value, String name) Validates the state of afloat
.requireThat
(int[] value, String name) Validates the state of a primitiveint
array.requireThat
(int value, String name) Validates the state of anint
.requireThat
(long[] value, String name) Validates the state of a primitivelong
array.requireThat
(long value, String name) Validates the state of along
.requireThat
(short[] value, String name) Validates the state of a primitiveshort
array.requireThat
(short value, String name) Validates the state of ashort
.<T> GenericTypeValidator
<T> requireThat
(GenericType<T> value, String name) Validates the state of aClass
.<E> ObjectArrayValidator
<E[], E> requireThat
(E[] value, String name) Validates the state of anObject
array.requireThat
(Boolean value, String name) Validates the state of aBoolean
.requireThat
(Byte value, String name) Validates the state of aByte
.requireThat
(Character value, String name) Validates the state of aCharacter
.<T> GenericTypeValidator
<T> requireThat
(Class<T> value, String name) Validates the state of aClass
.requireThat
(Double value, String name) Validates the state of aDouble
.requireThat
(Float value, String name) Validates the state of aFloat
.requireThat
(Integer value, String name) Validates the state of anInteger
.requireThat
(Long value, String name) Validates the state of aLong
.requireThat
(Short value, String name) Validates the state of aShort
.requireThat
(String value, String name) Validates the state of aString
.requireThat
(BigDecimal value, String name) Validates the state of aBigDecimal
.requireThat
(BigInteger value, String name) Validates the state of aBigInteger
.requireThat
(InetAddress value, String name) Validates the state of anInetAddress
.requireThat
(URI value, String name) Validates the state of aURI
.requireThat
(Path value, String name) Validates the state of aPath
.<T> OptionalValidator
<T> requireThat
(Optional<T> value, String name) Validates the state of anOptional
.<T extends Comparable<T>>
ComparableValidator<T> requireThat
(T value, String name) Validates the state of aComparable
object.
-
Method Details
-
requireThat
Validates the state of abyte
.The returned validator throws an exception immediately if a validation fails.
- Parameters:
value
- the valuename
- the name of the value- Returns:
- a validator for the value
- Throws:
NullPointerException
- ifname
is nullIllegalArgumentException
- ifname
contains whitespace, or is empty
-
requireThat
Validates the state of aByte
.The returned validator throws an exception immediately if a validation fails.
- Parameters:
value
- the valuename
- the name of the value- Returns:
- a validator for the value
- Throws:
NullPointerException
- ifname
is nullIllegalArgumentException
- ifname
contains whitespace, or is empty
-
requireThat
Validates the state of ashort
.The returned validator throws an exception immediately if a validation fails.
- Parameters:
value
- the valuename
- the name of the value- Returns:
- a validator for the value
- Throws:
NullPointerException
- ifname
is nullIllegalArgumentException
- ifname
contains whitespace, or is empty
-
requireThat
Validates the state of aShort
.The returned validator throws an exception immediately if a validation fails.
- Parameters:
value
- the valuename
- the name of the value- Returns:
- a validator for the value
- Throws:
NullPointerException
- ifname
is nullIllegalArgumentException
- ifname
contains whitespace, or is empty
-
requireThat
Validates the state of anint
.The returned validator throws an exception immediately if a validation fails.
- Parameters:
value
- the valuename
- the name of the value- Returns:
- a validator for the value
- Throws:
NullPointerException
- ifname
is nullIllegalArgumentException
- ifname
contains whitespace, or is empty
-
requireThat
Validates the state of anInteger
.The returned validator throws an exception immediately if a validation fails.
- Parameters:
value
- the valuename
- the name of the value- Returns:
- a validator for the value
- Throws:
NullPointerException
- ifname
is nullIllegalArgumentException
- ifname
contains whitespace, or is empty
-
requireThat
Validates the state of along
.The returned validator throws an exception immediately if a validation fails.
- Parameters:
value
- the valuename
- the name of the value- Returns:
- a validator for the value
- Throws:
NullPointerException
- ifname
is nullIllegalArgumentException
- ifname
contains whitespace, or is empty
-
requireThat
Validates the state of aLong
.The returned validator throws an exception immediately if a validation fails.
- Parameters:
value
- the valuename
- the name of the value- Returns:
- a validator for the value
- Throws:
NullPointerException
- ifname
is nullIllegalArgumentException
- ifname
contains whitespace, or is empty
-
requireThat
Validates the state of afloat
.The returned validator throws an exception immediately if a validation fails.
- Parameters:
value
- the valuename
- the name of the value- Returns:
- a validator for the value
- Throws:
NullPointerException
- ifname
is nullIllegalArgumentException
- ifname
contains whitespace, or is empty
-
requireThat
Validates the state of aFloat
.The returned validator throws an exception immediately if a validation fails.
- Parameters:
value
- the valuename
- the name of the value- Returns:
- a validator for the value
- Throws:
NullPointerException
- ifname
is nullIllegalArgumentException
- ifname
contains whitespace, or is empty
-
requireThat
Validates the state of adouble
.The returned validator throws an exception immediately if a validation fails.
- Parameters:
value
- the valuename
- the name of the value- Returns:
- a validator for the value
- Throws:
NullPointerException
- ifname
is nullIllegalArgumentException
- ifname
contains whitespace, or is empty
-
requireThat
Validates the state of aDouble
.The returned validator throws an exception immediately if a validation fails.
- Parameters:
value
- the valuename
- the name of the value- Returns:
- a validator for the value
- Throws:
NullPointerException
- ifname
is nullIllegalArgumentException
- ifname
contains whitespace or is empty
-
requireThat
Validates the state of aboolean
.The returned validator throws an exception immediately if a validation fails.
- Parameters:
value
- the valuename
- the name of the value- Returns:
- a validator for the value
- Throws:
NullPointerException
- ifname
is nullIllegalArgumentException
- ifname
contains whitespace or is empty
-
requireThat
Validates the state of aBoolean
.The returned validator throws an exception immediately if a validation fails.
- Parameters:
value
- the valuename
- the name of the value- Returns:
- a validator for the value
- Throws:
NullPointerException
- ifname
is nullIllegalArgumentException
- ifname
contains whitespace or is empty
-
requireThat
Validates the state of achar
.The returned validator throws an exception immediately if a validation fails.
- Parameters:
value
- the valuename
- the name of the value- Returns:
- a validator for the value
- Throws:
NullPointerException
- ifname
is nullIllegalArgumentException
- ifname
contains whitespace or is empty
-
requireThat
Validates the state of aCharacter
.The returned validator throws an exception immediately if a validation fails.
- Parameters:
value
- the valuename
- the name of the value- Returns:
- a validator for the value
- Throws:
NullPointerException
- ifname
is nullIllegalArgumentException
- ifname
contains whitespace or is empty
-
requireThat
Validates the state of aBigInteger
.The returned validator throws an exception immediately if a validation fails.
- Parameters:
value
- the valuename
- the name of the value- Returns:
- a validator for the value
- Throws:
NullPointerException
- ifname
is nullIllegalArgumentException
- ifname
contains whitespace or is empty
-
requireThat
Validates the state of aBigDecimal
.The returned validator throws an exception immediately if a validation fails.
- Parameters:
value
- the valuename
- the name of the value- Returns:
- a validator for the value
- Throws:
NullPointerException
- ifname
is nullIllegalArgumentException
- ifname
contains whitespace or is empty
-
requireThat
Validates the state of aComparable
object.The returned validator throws an exception immediately if a validation fails.
- Type Parameters:
T
- the type of the value- Parameters:
value
- the valuename
- the name of the value- Returns:
- a validator for the value
- Throws:
NullPointerException
- ifname
is nullIllegalArgumentException
- ifname
contains whitespace or is empty
-
requireThat
Validates the state of anObject
.The returned validator throws an exception immediately if a validation fails.
- Type Parameters:
T
- the type of the value- Parameters:
value
- the valuename
- the name of the value- Returns:
- a validator for the value
- Throws:
NullPointerException
- ifname
is nullIllegalArgumentException
- ifname
contains whitespace or is empty
-
requireThat
Validates the state of aCollection
.The returned validator throws an exception immediately if a validation fails.
- Type Parameters:
T
- the type of the valueE
- the type of elements in the collection- Parameters:
value
- the valuename
- the name of the value- Returns:
- a validator for the value
- Throws:
NullPointerException
- ifname
is nullIllegalArgumentException
- ifname
contains whitespace or is empty
-
requireThat
Validates the state of aList
.The returned validator throws an exception immediately if a validation fails.
- Type Parameters:
T
- the type of the valueE
- the type of elements in the list- Parameters:
value
- the valuename
- the name of the value- Returns:
- a validator for the value
- Throws:
NullPointerException
- ifname
is nullIllegalArgumentException
- ifname
contains whitespace or is empty
-
requireThat
Validates the state of a primitivebyte
array.The returned validator throws an exception immediately if a validation fails.
- Parameters:
value
- the valuename
- the name of the value- Returns:
- a validator for the value
- Throws:
NullPointerException
- ifname
is nullIllegalArgumentException
- ifname
contains whitespace or is empty
-
requireThat
Validates the state of a primitiveshort
array.The returned validator throws an exception immediately if a validation fails.
- Parameters:
value
- the valuename
- the name of the value- Returns:
- a validator for the value
- Throws:
NullPointerException
- ifname
is nullIllegalArgumentException
- ifname
contains whitespace or is empty
-
requireThat
Validates the state of a primitiveint
array.The returned validator throws an exception immediately if a validation fails.
- Parameters:
value
- the valuename
- the name of the value- Returns:
- a validator for the value
- Throws:
NullPointerException
- ifname
is nullIllegalArgumentException
- ifname
contains whitespace or is empty
-
requireThat
Validates the state of a primitivelong
array.The returned validator throws an exception immediately if a validation fails.
- Parameters:
value
- the valuename
- the name of the value- Returns:
- a validator for the value
- Throws:
NullPointerException
- ifname
is nullIllegalArgumentException
- ifname
contains whitespace or is empty
-
requireThat
Validates the state of a primitivefloat
array.The returned validator throws an exception immediately if a validation fails.
- Parameters:
value
- the valuename
- the name of the value- Returns:
- a validator for the value
- Throws:
NullPointerException
- ifname
is nullIllegalArgumentException
- ifname
contains whitespace or is empty
-
requireThat
Validates the state of a primitivedouble
array.The returned validator throws an exception immediately if a validation fails.
- Parameters:
value
- the valuename
- the name of the value- Returns:
- a validator for the value
- Throws:
NullPointerException
- ifname
is nullIllegalArgumentException
- ifname
contains whitespace or is empty
-
requireThat
Validates the state of a primitiveboolean
array.The returned validator throws an exception immediately if a validation fails.
- Parameters:
value
- the valuename
- the name of the value- Returns:
- a validator for the value
- Throws:
NullPointerException
- ifname
is nullIllegalArgumentException
- ifname
contains whitespace or is empty
-
requireThat
Validates the state of a primitivechar
array.The returned validator throws an exception immediately if a validation fails.
- Parameters:
value
- the valuename
- the name of the value- Returns:
- a validator for the value
- Throws:
NullPointerException
- ifname
is nullIllegalArgumentException
- ifname
contains whitespace or is empty
-
requireThat
Validates the state of anObject
array.The returned validator throws an exception immediately if a validation fails.
- Type Parameters:
E
- the type of elements in the array- Parameters:
value
- the valuename
- the name of the value- Returns:
- a validator for the value
- Throws:
NullPointerException
- ifname
is nullIllegalArgumentException
- ifname
contains whitespace or is empty
-
requireThat
Validates the state of aMap
.The returned validator throws an exception immediately if a validation fails.
- Type Parameters:
T
- the type of the mapK
- the type of keys in the mapV
- the type of values in the map- Parameters:
value
- the valuename
- the name of the value- Returns:
- a validator for the value
- Throws:
NullPointerException
- ifname
is nullIllegalArgumentException
- ifname
contains whitespace or is empty
-
requireThat
Validates the state of aPath
.The returned validator throws an exception immediately if a validation fails.
- Parameters:
value
- the valuename
- the name of the value- Returns:
- a validator for the value
- Throws:
NullPointerException
- ifname
is nullIllegalArgumentException
- ifname
contains whitespace or is empty
-
requireThat
Validates the state of aString
.The returned validator throws an exception immediately if a validation fails.
- Parameters:
value
- the valuename
- the name of the value- Returns:
- a validator for the value
- Throws:
NullPointerException
- ifname
is nullIllegalArgumentException
- ifname
contains whitespace or is empty
-
requireThat
Validates the state of aURI
.The returned validator throws an exception immediately if a validation fails.
- Parameters:
value
- the valuename
- the name of the value- Returns:
- a validator for the value
- Throws:
NullPointerException
- ifname
is nullIllegalArgumentException
- ifname
contains whitespace or is empty
-
requireThat
Validates the state of aClass
.The returned validator throws an exception immediately if a validation fails.
- Type Parameters:
T
- the type of the class modelled by theClass
object. For types that contain type-parameters, use theTypeToken
overload.- Parameters:
value
- the valuename
- the name of the value- Returns:
- a validator for the value
- Throws:
NullPointerException
- ifname
is nullIllegalArgumentException
- ifname
contains whitespace or is empty
-
requireThat
Validates the state of aClass
.The returned validator throws an exception immediately if a validation fails.
- Type Parameters:
T
- the type of the class modelled by theClass
object. For types without type-parameters, prefer theClass
overload.- Parameters:
value
- the valuename
- the name of the value- Returns:
- a validator for the value
- Throws:
NullPointerException
- ifname
is nullIllegalArgumentException
- ifname
contains whitespace or is empty
-
requireThat
Validates the state of anOptional
.The returned validator throws an exception immediately if a validation fails.
- Type Parameters:
T
- the type of optional- Parameters:
value
- the valuename
- the name of the value- Returns:
- a validator for the value
- Throws:
NullPointerException
- ifname
is nullIllegalArgumentException
- ifname
contains whitespace or is empty
-
requireThat
Validates the state of anInetAddress
.The returned validator throws an exception immediately if a validation fails.
- Parameters:
value
- the valuename
- the name of the value- Returns:
- a validator for the value
- Throws:
NullPointerException
- ifname
is nullIllegalArgumentException
- ifname
contains whitespace or is empty
-