Class DefaultJavaValidators
There are three kinds of validators:
requireThat()
for method preconditions.assert that()
for class invariants, and method postconditions.checkIf()
for returning multiple validation failures.
Thread Safety: This class is thread-safe.
-
Method Summary
Modifier and TypeMethodDescriptionstatic PrimitiveBooleanValidator
checkIf
(boolean value) Validates the state of aboolean
checkIf
(boolean[] value) Validates the state of a primitiveboolean
array.Validates the state of a primitiveboolean
array.static PrimitiveBooleanValidator
Validates the state of aboolean
static PrimitiveByteValidator
checkIf
(byte value) Validates the state of abyte
static PrimitiveByteArrayValidator
checkIf
(byte[] value) Validates the state of a primitivebyte
array.static PrimitiveByteArrayValidator
Validates the state of a primitivebyte
array.static PrimitiveByteValidator
Validates the state of abyte
.static PrimitiveCharacterValidator
checkIf
(char value) Validates the state of achar
checkIf
(char[] value) Validates the state of a primitivechar
array.Validates the state of a primitivechar
array.static PrimitiveCharacterValidator
Validates the state of achar
static PrimitiveDoubleValidator
checkIf
(double value) Validates the state of adouble
checkIf
(double[] value) Validates the state of a primitivedouble
array.Validates the state of a primitivedouble
array.static PrimitiveDoubleValidator
Validates the state of adouble
static PrimitiveFloatValidator
checkIf
(float value) Validates the state of afloat
static PrimitiveFloatArrayValidator
checkIf
(float[] value) Validates the state of a primitivefloat
array.static PrimitiveFloatArrayValidator
Validates the state of a primitivefloat
array.static PrimitiveFloatValidator
Validates the state of afloat
static PrimitiveIntegerValidator
checkIf
(int value) Validates the state of anint
checkIf
(int[] value) Validates the state of a primitiveint
array.Validates the state of a primitiveint
array.static PrimitiveIntegerValidator
Validates the state of anint
static PrimitiveLongValidator
checkIf
(long value) Validates the state of along
static PrimitiveLongArrayValidator
checkIf
(long[] value) Validates the state of a primitivelong
array.static PrimitiveLongArrayValidator
Validates the state of a primitivelong
array.static PrimitiveLongValidator
Validates the state of along
static PrimitiveShortValidator
checkIf
(short value) Validates the state of ashort
static PrimitiveShortArrayValidator
checkIf
(short[] value) Validates the state of a primitiveshort
array.static PrimitiveShortArrayValidator
Validates the state of a primitiveshort
array.static PrimitiveShortValidator
Validates the state of ashort
static <E> ObjectArrayValidator
<E[], E> checkIf
(E[] value) Validates the state of anObject
array.static <E> ObjectArrayValidator
<E[], E> Validates the state of anObject
array.static BooleanValidator
Validates the state of aBoolean
static BooleanValidator
Validates the state of aBoolean
static ByteValidator
Validates the state of aByte
static ByteValidator
Validates the state of aByte
static CharacterValidator
Validates the state of aCharacter
static CharacterValidator
Validates the state of aCharacter
static <T> GenericTypeValidator
<T> Validates the state of aClass
.static <T> GenericTypeValidator
<T> Validates the state of aClass
.static DoubleValidator
Validates the state of aDouble
static DoubleValidator
Validates the state of aDouble
static FloatValidator
Validates the state of aFloat
static FloatValidator
Validates the state of aFloat
static IntegerValidator
Validates the state of anInteger
static IntegerValidator
Validates the state of anInteger
static LongValidator
Validates the state of aLong
static LongValidator
Validates the state of aLong
static ShortValidator
Validates the state of aShort
static ShortValidator
Validates the state of aShort
static StringValidator
Validates the state of aString
.static StringValidator
Validates the state of aString
.static BigDecimalValidator
checkIf
(BigDecimal value) Validates the state of aBigDecimal
static BigDecimalValidator
checkIf
(BigDecimal value, String name) Validates the state of aBigDecimal
static BigIntegerValidator
checkIf
(BigInteger value) Validates the state of aBigInteger
static BigIntegerValidator
checkIf
(BigInteger value, String name) Validates the state of aBigInteger
static InetAddressValidator
checkIf
(InetAddress value) Validates the state of anInetAddress
.static InetAddressValidator
checkIf
(InetAddress value, String name) Validates the state of anInetAddress
.static UriValidator
Validates the state of aURI
.static UriValidator
Validates the state of aURI
.static PathValidator
Validates the state of aPath
.static PathValidator
Validates the state of aPath
.static <T> OptionalValidator
<T> Validates the state of anOptional
.static <T> OptionalValidator
<T> Validates the state of anOptional
.static <T extends Comparable<T>>
ComparableValidator<T> checkIf
(T value) Validates the state of aComparable
object.static <T extends Comparable<T>>
ComparableValidator<T> Validates the state of aComparable
object.Returns the contextual information for validators created out by this factory.static GlobalConfiguration
Returns the global configuration shared by all validators.static JavaValidators
removeContext
(String name) Removes the contextual information of validators created by this factory.requireThat
(boolean[] value, String name) Validates the state of a primitiveboolean
array.static PrimitiveBooleanValidator
requireThat
(boolean value, String name) Validates the state of aboolean
.static PrimitiveByteArrayValidator
requireThat
(byte[] value, String name) Validates the state of a primitivebyte
array.static PrimitiveByteValidator
requireThat
(byte value, String name) Validates the state of abyte
.requireThat
(char[] value, String name) Validates the state of a primitivechar
array.static PrimitiveCharacterValidator
requireThat
(char value, String name) Validates the state of achar
.requireThat
(double[] value, String name) Validates the state of a primitivedouble
array.static PrimitiveDoubleValidator
requireThat
(double value, String name) Validates the state of adouble
.static PrimitiveFloatArrayValidator
requireThat
(float[] value, String name) Validates the state of a primitivefloat
array.static PrimitiveFloatValidator
requireThat
(float value, String name) Validates the state of afloat
.requireThat
(int[] value, String name) Validates the state of a primitiveint
array.static PrimitiveIntegerValidator
requireThat
(int value, String name) Validates the state of anint
.static PrimitiveLongArrayValidator
requireThat
(long[] value, String name) Validates the state of a primitivelong
array.static PrimitiveLongValidator
requireThat
(long value, String name) Validates the state of along
.static PrimitiveShortArrayValidator
requireThat
(short[] value, String name) Validates the state of a primitiveshort
array.static PrimitiveShortValidator
requireThat
(short value, String name) Validates the state of ashort
.static <E> ObjectArrayValidator
<E[], E> requireThat
(E[] value, String name) Validates the state of anObject
array.static BooleanValidator
requireThat
(Boolean value, String name) Validates the state of aBoolean
.static ByteValidator
requireThat
(Byte value, String name) Validates the state of aByte
.static CharacterValidator
requireThat
(Character value, String name) Validates the state of aCharacter
.static <T> GenericTypeValidator
<T> requireThat
(Class<T> value, String name) Validates the state of aClass
.static DoubleValidator
requireThat
(Double value, String name) Validates the state of aDouble
.static FloatValidator
requireThat
(Float value, String name) Validates the state of aFloat
.static IntegerValidator
requireThat
(Integer value, String name) Validates the state of anInteger
.static LongValidator
requireThat
(Long value, String name) Validates the state of aLong
.static ShortValidator
requireThat
(Short value, String name) Validates the state of aShort
.static StringValidator
requireThat
(String value, String name) Validates the state of aString
.static BigDecimalValidator
requireThat
(BigDecimal value, String name) Validates the state of aBigDecimal
.static BigIntegerValidator
requireThat
(BigInteger value, String name) Validates the state of aBigInteger
.static InetAddressValidator
requireThat
(InetAddress value, String name) Validates the state of anInetAddress
.static UriValidator
requireThat
(URI value, String name) Validates the state of aURI
.static PathValidator
requireThat
(Path value, String name) Validates the state of aPath
.static <T> OptionalValidator
<T> requireThat
(Optional<T> value, String name) Validates the state of anOptional
.static <T extends Comparable<T>>
ComparableValidator<T> requireThat
(T value, String name) Validates the state of aComparable
object.static PrimitiveBooleanValidator
that
(boolean value) Validates the state of aboolean
.that
(boolean[] value) Validates the state of a primitiveboolean
array.Validates the state of a primitiveboolean
array.static PrimitiveBooleanValidator
Validates the state of aboolean
.static PrimitiveByteValidator
that
(byte value) Validates the state of abyte
.static PrimitiveByteArrayValidator
that
(byte[] value) Validates the state of a primitivebyte
array.static PrimitiveByteArrayValidator
Validates the state of a primitivebyte
array.static PrimitiveByteValidator
Validates the state of abyte
.static PrimitiveCharacterValidator
that
(char value) Validates the state of achar
.that
(char[] value) Validates the state of a primitivechar
array.Validates the state of a primitivechar
array.static PrimitiveCharacterValidator
Validates the state of achar
.static PrimitiveDoubleValidator
that
(double value) Validates the state of adouble
.that
(double[] value) Validates the state of a primitivedouble
array.Validates the state of a primitivedouble
array.static PrimitiveDoubleValidator
Validates the state of adouble
.static PrimitiveFloatValidator
that
(float value) Validates the state of afloat
.static PrimitiveFloatArrayValidator
that
(float[] value) Validates the state of a primitivefloat
array.static PrimitiveFloatArrayValidator
Validates the state of a primitivefloat
array.static PrimitiveFloatValidator
Validates the state of afloat
.static PrimitiveIntegerValidator
that
(int value) Validates the state of anint
.that
(int[] value) Validates the state of a primitiveint
array.Validates the state of a primitiveint
array.static PrimitiveIntegerValidator
Validates the state of anint
.static PrimitiveLongValidator
that
(long value) Validates the state of along
.static PrimitiveLongArrayValidator
that
(long[] value) Validates the state of a primitivelong
array.static PrimitiveLongArrayValidator
Validates the state of a primitivelong
array.static PrimitiveLongValidator
Validates the state of along
.static PrimitiveShortValidator
that
(short value) Validates the state of ashort
.static PrimitiveShortArrayValidator
that
(short[] value) Validates the state of a primitiveshort
array.static PrimitiveShortArrayValidator
Validates the state of a primitiveshort
array.static PrimitiveShortValidator
Validates the state of ashort
.static <E> ObjectArrayValidator
<E[], E> that
(E[] value) Validates the state of anObject
array.static <E> ObjectArrayValidator
<E[], E> Validates the state of anObject
array.static BooleanValidator
Validates the state of aBoolean
.static BooleanValidator
Validates the state of aBoolean
.static ByteValidator
Validates the state of aByte
.static ByteValidator
Validates the state of aByte
.static CharacterValidator
Validates the state of aCharacter
.static CharacterValidator
Validates the state of aCharacter
.static <T> GenericTypeValidator
<T> Validates the state of aClass
.static <T> GenericTypeValidator
<T> Validates the state of aClass
.static DoubleValidator
Validates the state of aDouble
.static DoubleValidator
Validates the state of aDouble
.static FloatValidator
Validates the state of aFloat
.static FloatValidator
Validates the state of aFloat
.static IntegerValidator
Validates the state of anInteger
.static IntegerValidator
Validates the state of anInteger
.static LongValidator
Validates the state of aLong
.static LongValidator
Validates the state of aLong
.static ShortValidator
Validates the state of aShort
.static ShortValidator
Validates the state of aShort
.static StringValidator
Validates the state of aString
.static StringValidator
Validates the state of aString
.static BigDecimalValidator
that
(BigDecimal value) Validates the state of aBigDecimal
.static BigDecimalValidator
that
(BigDecimal value, String name) Validates the state of aBigDecimal
.static BigIntegerValidator
that
(BigInteger value) Validates the state of aBigInteger
.static BigIntegerValidator
that
(BigInteger value, String name) Validates the state of aBigInteger
.static InetAddressValidator
that
(InetAddress value) Validates the state of anInetAddress
.static InetAddressValidator
that
(InetAddress value, String name) Validates the state of anInetAddress
.static UriValidator
Validates the state of aURI
.static UriValidator
Validates the state of aURI
.static PathValidator
Validates the state of aPath
.static PathValidator
Validates the state of aPath
.static <T> OptionalValidator
<T> Validates the state of anOptional
.static <T> OptionalValidator
<T> Validates the state of anOptional
.static <T extends Comparable<T>>
ComparableValidator<T> that
(T value) Validates the state of aComparable
object.static <T extends Comparable<T>>
ComparableValidator<T> Validates the state of aComparable
object.static JavaValidators
withContext
(Object value, String name) Sets the contextual information for validators created by this factory.
-
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
public static <T extends Collection<E>,E> CollectionValidator<T,E> requireThat(T value, String name) 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- 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
-
that
Validates the state of abyte
.The returned validator captures exceptions on validation failure rather than throwing them immediately. The exceptions are converted into an
AssertionError
and can be retrieved or thrown once the validation completes. Exceptions unrelated to validation failures are thrown immediately.This method is intended to be used with the
assert
keyword, like so:assert that(value, name)
.- 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
-
that
Validates the state of abyte
.The returned validator captures exceptions on validation failure rather than throwing them immediately. The exceptions are converted into an
AssertionError
and can be retrieved or thrown once the validation completes. Exceptions unrelated to validation failures are thrown immediately.This method is intended to be used with the
assert
keyword, like so:assert that(value, name)
.- Parameters:
value
- the value- Returns:
- a validator for the value
-
that
Validates the state of aByte
.The returned validator captures exceptions on validation failure rather than throwing them immediately. The exceptions are converted into an
AssertionError
and can be retrieved or thrown once the validation completes. Exceptions unrelated to validation failures are thrown immediately.This method is intended to be used with the
assert
keyword, like so:assert that(value, name)
.- 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
-
that
Validates the state of aByte
.The returned validator captures exceptions on validation failure rather than throwing them immediately. The exceptions are converted into an
AssertionError
and can be retrieved or thrown once the validation completes. Exceptions unrelated to validation failures are thrown immediately.This method is intended to be used with the
assert
keyword, like so:assert that(value, name)
.- Parameters:
value
- the value- Returns:
- a validator for the value
-
that
Validates the state of ashort
.The returned validator captures exceptions on validation failure rather than throwing them immediately. The exceptions are converted into an
AssertionError
and can be retrieved or thrown once the validation completes. Exceptions unrelated to validation failures are thrown immediately.This method is intended to be used with the
assert
keyword, like so:assert that(value, name)
.- 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
-
that
Validates the state of ashort
.The returned validator captures exceptions on validation failure rather than throwing them immediately. The exceptions are converted into an
AssertionError
and can be retrieved or thrown once the validation completes. Exceptions unrelated to validation failures are thrown immediately.This method is intended to be used with the
assert
keyword, like so:assert that(value, name)
.- Parameters:
value
- the value- Returns:
- a validator for the value
-
that
Validates the state of aShort
.The returned validator captures exceptions on validation failure rather than throwing them immediately. The exceptions are converted into an
AssertionError
and can be retrieved or thrown once the validation completes. Exceptions unrelated to validation failures are thrown immediately.This method is intended to be used with the
assert
keyword, like so:assert that(value, name)
.- 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
-
that
Validates the state of aShort
.The returned validator captures exceptions on validation failure rather than throwing them immediately. The exceptions are converted into an
AssertionError
and can be retrieved or thrown once the validation completes. Exceptions unrelated to validation failures are thrown immediately.This method is intended to be used with the
assert
keyword, like so:assert that(value, name)
.- Parameters:
value
- the value- Returns:
- a validator for the value
-
that
Validates the state of anint
.The returned validator captures exceptions on validation failure rather than throwing them immediately. The exceptions are converted into an
AssertionError
and can be retrieved or thrown once the validation completes. Exceptions unrelated to validation failures are thrown immediately.This method is intended to be used with the
assert
keyword, like so:assert that(value, name)
.- 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
-
that
Validates the state of anint
.The returned validator captures exceptions on validation failure rather than throwing them immediately. The exceptions are converted into an
AssertionError
and can be retrieved or thrown once the validation completes. Exceptions unrelated to validation failures are thrown immediately.This method is intended to be used with the
assert
keyword, like so:assert that(value, name)
.- Parameters:
value
- the value- Returns:
- a validator for the value
-
that
Validates the state of anInteger
.The returned validator captures exceptions on validation failure rather than throwing them immediately. The exceptions are converted into an
AssertionError
and can be retrieved or thrown once the validation completes. Exceptions unrelated to validation failures are thrown immediately.This method is intended to be used with the
assert
keyword, like so:assert that(value, name)
.- 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
-
that
Validates the state of anInteger
.The returned validator captures exceptions on validation failure rather than throwing them immediately. The exceptions are converted into an
AssertionError
and can be retrieved or thrown once the validation completes. Exceptions unrelated to validation failures are thrown immediately.This method is intended to be used with the
assert
keyword, like so:assert that(value, name)
.- Parameters:
value
- the value- Returns:
- a validator for the value
-
that
Validates the state of along
.The returned validator captures exceptions on validation failure rather than throwing them immediately. The exceptions are converted into an
AssertionError
and can be retrieved or thrown once the validation completes. Exceptions unrelated to validation failures are thrown immediately.This method is intended to be used with the
assert
keyword, like so:assert that(value, name)
.- 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
-
that
Validates the state of along
.The returned validator captures exceptions on validation failure rather than throwing them immediately. The exceptions are converted into an
AssertionError
and can be retrieved or thrown once the validation completes. Exceptions unrelated to validation failures are thrown immediately.This method is intended to be used with the
assert
keyword, like so:assert that(value, name)
.- Parameters:
value
- the value- Returns:
- a validator for the value
-
that
Validates the state of aLong
.The returned validator captures exceptions on validation failure rather than throwing them immediately. The exceptions are converted into an
AssertionError
and can be retrieved or thrown once the validation completes. Exceptions unrelated to validation failures are thrown immediately.This method is intended to be used with the
assert
keyword, like so:assert that(value, name)
.- 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
-
that
Validates the state of aLong
.The returned validator captures exceptions on validation failure rather than throwing them immediately. The exceptions are converted into an
AssertionError
and can be retrieved or thrown once the validation completes. Exceptions unrelated to validation failures are thrown immediately.This method is intended to be used with the
assert
keyword, like so:assert that(value, name)
.- Parameters:
value
- the value- Returns:
- a validator for the value
-
that
Validates the state of afloat
.The returned validator captures exceptions on validation failure rather than throwing them immediately. The exceptions are converted into an
AssertionError
and can be retrieved or thrown once the validation completes. Exceptions unrelated to validation failures are thrown immediately.This method is intended to be used with the
assert
keyword, like so:assert that(value, name)
.- 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
-
that
Validates the state of afloat
.The returned validator captures exceptions on validation failure rather than throwing them immediately. The exceptions are converted into an
AssertionError
and can be retrieved or thrown once the validation completes. Exceptions unrelated to validation failures are thrown immediately.This method is intended to be used with the
assert
keyword, like so:assert that(value, name)
.- Parameters:
value
- the value- Returns:
- a validator for the value
-
that
Validates the state of aFloat
.The returned validator captures exceptions on validation failure rather than throwing them immediately. The exceptions are converted into an
AssertionError
and can be retrieved or thrown once the validation completes. Exceptions unrelated to validation failures are thrown immediately.This method is intended to be used with the
assert
keyword, like so:assert that(value, name)
.- 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
-
that
Validates the state of aFloat
.The returned validator captures exceptions on validation failure rather than throwing them immediately. The exceptions are converted into an
AssertionError
and can be retrieved or thrown once the validation completes. Exceptions unrelated to validation failures are thrown immediately.This method is intended to be used with the
assert
keyword, like so:assert that(value, name)
.- Parameters:
value
- the value- Returns:
- a validator for the value
-
that
Validates the state of adouble
.The returned validator captures exceptions on validation failure rather than throwing them immediately. The exceptions are converted into an
AssertionError
and can be retrieved or thrown once the validation completes. Exceptions unrelated to validation failures are thrown immediately.This method is intended to be used with the
assert
keyword, like so:assert that(value, name)
.- 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
-
that
Validates the state of adouble
.The returned validator captures exceptions on validation failure rather than throwing them immediately. The exceptions are converted into an
AssertionError
and can be retrieved or thrown once the validation completes. Exceptions unrelated to validation failures are thrown immediately.This method is intended to be used with the
assert
keyword, like so:assert that(value, name)
.- Parameters:
value
- the value- Returns:
- a validator for the value
-
that
Validates the state of aDouble
.The returned validator captures exceptions on validation failure rather than throwing them immediately. The exceptions are converted into an
AssertionError
and can be retrieved or thrown once the validation completes. Exceptions unrelated to validation failures are thrown immediately.This method is intended to be used with the
assert
keyword, like so:assert that(value, name)
.- 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
-
that
Validates the state of aDouble
.The returned validator captures exceptions on validation failure rather than throwing them immediately. The exceptions are converted into an
AssertionError
and can be retrieved or thrown once the validation completes. Exceptions unrelated to validation failures are thrown immediately.This method is intended to be used with the
assert
keyword, like so:assert that(value, name)
.- Parameters:
value
- the value- Returns:
- a validator for the value
-
that
Validates the state of aboolean
.The returned validator captures exceptions on validation failure rather than throwing them immediately. The exceptions are converted into an
AssertionError
and can be retrieved or thrown once the validation completes. Exceptions unrelated to validation failures are thrown immediately.This method is intended to be used with the
assert
keyword, like so:assert that(value, name)
.- 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
-
that
Validates the state of aboolean
.The returned validator captures exceptions on validation failure rather than throwing them immediately. The exceptions are converted into an
AssertionError
and can be retrieved or thrown once the validation completes. Exceptions unrelated to validation failures are thrown immediately.This method is intended to be used with the
assert
keyword, like so:assert that(value, name)
.- Parameters:
value
- the value- Returns:
- a validator for the value
-
that
Validates the state of aBoolean
.The returned validator captures exceptions on validation failure rather than throwing them immediately. The exceptions are converted into an
AssertionError
and can be retrieved or thrown once the validation completes. Exceptions unrelated to validation failures are thrown immediately.This method is intended to be used with the
assert
keyword, like so:assert that(value, name)
.- 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
-
that
Validates the state of aBoolean
.The returned validator captures exceptions on validation failure rather than throwing them immediately. The exceptions are converted into an
AssertionError
and can be retrieved or thrown once the validation completes. Exceptions unrelated to validation failures are thrown immediately.This method is intended to be used with the
assert
keyword, like so:assert that(value, name)
.- Parameters:
value
- the value- Returns:
- a validator for the value
-
that
Validates the state of achar
.The returned validator captures exceptions on validation failure rather than throwing them immediately. The exceptions are converted into an
AssertionError
and can be retrieved or thrown once the validation completes. Exceptions unrelated to validation failures are thrown immediately.This method is intended to be used with the
assert
keyword, like so:assert that(value, name)
.- 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
-
that
Validates the state of achar
.The returned validator captures exceptions on validation failure rather than throwing them immediately. The exceptions are converted into an
AssertionError
and can be retrieved or thrown once the validation completes. Exceptions unrelated to validation failures are thrown immediately.This method is intended to be used with the
assert
keyword, like so:assert that(value, name)
.- Parameters:
value
- the value- Returns:
- a validator for the value
-
that
Validates the state of aCharacter
.The returned validator captures exceptions on validation failure rather than throwing them immediately. The exceptions are converted into an
AssertionError
and can be retrieved or thrown once the validation completes. Exceptions unrelated to validation failures are thrown immediately.This method is intended to be used with the
assert
keyword, like so:assert that(value, name)
.- 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
-
that
Validates the state of aCharacter
.The returned validator captures exceptions on validation failure rather than throwing them immediately. The exceptions are converted into an
AssertionError
and can be retrieved or thrown once the validation completes. Exceptions unrelated to validation failures are thrown immediately.This method is intended to be used with the
assert
keyword, like so:assert that(value, name)
.- Parameters:
value
- the value- Returns:
- a validator for the value
-
that
Validates the state of aBigInteger
.The returned validator captures exceptions on validation failure rather than throwing them immediately. The exceptions are converted into an
AssertionError
and can be retrieved or thrown once the validation completes. Exceptions unrelated to validation failures are thrown immediately.This method is intended to be used with the
assert
keyword, like so:assert that(value, name)
.- 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
-
that
Validates the state of aBigInteger
.The returned validator captures exceptions on validation failure rather than throwing them immediately. The exceptions are converted into an
AssertionError
and can be retrieved or thrown once the validation completes. Exceptions unrelated to validation failures are thrown immediately.This method is intended to be used with the
assert
keyword, like so:assert that(value, name)
.- Parameters:
value
- the value- Returns:
- a validator for the value
-
that
Validates the state of aBigDecimal
.The returned validator captures exceptions on validation failure rather than throwing them immediately. The exceptions are converted into an
AssertionError
and can be retrieved or thrown once the validation completes. Exceptions unrelated to validation failures are thrown immediately.This method is intended to be used with the
assert
keyword, like so:assert that(value, name)
.- 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
-
that
Validates the state of aBigDecimal
.The returned validator captures exceptions on validation failure rather than throwing them immediately. The exceptions are converted into an
AssertionError
and can be retrieved or thrown once the validation completes. Exceptions unrelated to validation failures are thrown immediately.This method is intended to be used with the
assert
keyword, like so:assert that(value, name)
.- Parameters:
value
- the value- Returns:
- a validator for the value
-
that
Validates the state of aComparable
object.- 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
-
that
Validates the state of aComparable
object.- Type Parameters:
T
- the type of the value- Parameters:
value
- the value- Returns:
- a validator for the value
-
that
Validates the state of anObject
.The returned validator captures exceptions on validation failure rather than throwing them immediately. The exceptions are converted into an
AssertionError
and can be retrieved or thrown once the validation completes. Exceptions unrelated to validation failures are thrown immediately.This method is intended to be used with the
assert
keyword, like so:assert that(value, name)
.- Type Parameters:
T
- the type of 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
-
that
Validates the state of anObject
.The returned validator captures exceptions on validation failure rather than throwing them immediately. The exceptions are converted into an
AssertionError
and can be retrieved or thrown once the validation completes. Exceptions unrelated to validation failures are thrown immediately.This method is intended to be used with the
assert
keyword, like so:assert that(value, name)
.- Type Parameters:
T
- the type of value- Parameters:
value
- the value- Returns:
- a validator for the value
-
that
Validates the state of aCollection
.The returned validator captures exceptions on validation failure rather than throwing them immediately. The exceptions are converted into an
AssertionError
and can be retrieved or thrown once the validation completes. Exceptions unrelated to validation failures are thrown immediately.This method is intended to be used with the
assert
keyword, like so:assert that(value, name)
.- 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
-
that
Validates the state of aCollection
.The returned validator captures exceptions on validation failure rather than throwing them immediately. The exceptions are converted into an
AssertionError
and can be retrieved or thrown once the validation completes. Exceptions unrelated to validation failures are thrown immediately.This method is intended to be used with the
assert
keyword, like so:assert that(value, name)
.- Type Parameters:
T
- the type of the valueE
- the type of elements in the collection- Parameters:
value
- the value- Returns:
- a validator for the value
-
that
Validates the state of aList
.The returned validator captures exceptions on validation failure rather than throwing them immediately. The exceptions are converted into an
AssertionError
and can be retrieved or thrown once the validation completes. Exceptions unrelated to validation failures are thrown immediately.This method is intended to be used with the
assert
keyword, like so:assert that(value, name)
.- 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
-
that
Validates the state of aList
.The returned validator captures exceptions on validation failure rather than throwing them immediately. The exceptions are converted into an
AssertionError
and can be retrieved or thrown once the validation completes. Exceptions unrelated to validation failures are thrown immediately.This method is intended to be used with the
assert
keyword, like so:assert that(value, name)
.- Type Parameters:
T
- the type of the valueE
- the type of elements in the list- Parameters:
value
- the value- Returns:
- a validator for the value
-
that
Validates the state of a primitivebyte
array.The returned validator throws an exception immediately if a validation fails. This exception is then converted into an
AssertionError
. Exceptions unrelated to validation failures are not converted.This method is intended to be used with the
assert
keyword, like so:assert that(value, name)
.- 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
-
that
Validates the state of a primitivebyte
array.The returned validator throws an exception immediately if a validation fails. This exception is then converted into an
AssertionError
. Exceptions unrelated to validation failures are not converted.This method is intended to be used with the
assert
keyword, like so:assert that(value, name)
.- Parameters:
value
- the value- Returns:
- a validator for the value
-
that
Validates the state of a primitiveshort
array.The returned validator throws an exception immediately if a validation fails. This exception is then converted into an
AssertionError
. Exceptions unrelated to validation failures are not converted.This method is intended to be used with the
assert
keyword, like so:assert that(value, name)
.- 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
-
that
Validates the state of a primitiveshort
array.The returned validator throws an exception immediately if a validation fails. This exception is then converted into an
AssertionError
. Exceptions unrelated to validation failures are not converted.This method is intended to be used with the
assert
keyword, like so:assert that(value, name)
.- Parameters:
value
- the value- Returns:
- a validator for the value
-
that
Validates the state of a primitiveint
array.The returned validator throws an exception immediately if a validation fails. This exception is then converted into an
AssertionError
. Exceptions unrelated to validation failures are not converted.This method is intended to be used with the
assert
keyword, like so:assert that(value, name)
.- 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
-
that
Validates the state of a primitiveint
array.The returned validator throws an exception immediately if a validation fails. This exception is then converted into an
AssertionError
. Exceptions unrelated to validation failures are not converted.This method is intended to be used with the
assert
keyword, like so:assert that(value, name)
.- Parameters:
value
- the value- Returns:
- a validator for the value
-
that
Validates the state of a primitivelong
array.The returned validator throws an exception immediately if a validation fails. This exception is then converted into an
AssertionError
. Exceptions unrelated to validation failures are not converted.This method is intended to be used with the
assert
keyword, like so:assert that(value, name)
.- 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
-
that
Validates the state of a primitivelong
array.The returned validator throws an exception immediately if a validation fails. This exception is then converted into an
AssertionError
. Exceptions unrelated to validation failures are not converted.This method is intended to be used with the
assert
keyword, like so:assert that(value, name)
.- Parameters:
value
- the value- Returns:
- a validator for the value
-
that
Validates the state of a primitivefloat
array.The returned validator throws an exception immediately if a validation fails. This exception is then converted into an
AssertionError
. Exceptions unrelated to validation failures are not converted.This method is intended to be used with the
assert
keyword, like so:assert that(value, name)
.- 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
-
that
Validates the state of a primitivefloat
array.The returned validator throws an exception immediately if a validation fails. This exception is then converted into an
AssertionError
. Exceptions unrelated to validation failures are not converted.This method is intended to be used with the
assert
keyword, like so:assert that(value, name)
.- Parameters:
value
- the value- Returns:
- a validator for the value
-
that
Validates the state of a primitivedouble
array.The returned validator throws an exception immediately if a validation fails. This exception is then converted into an
AssertionError
. Exceptions unrelated to validation failures are not converted.This method is intended to be used with the
assert
keyword, like so:assert that(value, name)
.- 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
-
that
Validates the state of a primitivedouble
array.The returned validator throws an exception immediately if a validation fails. This exception is then converted into an
AssertionError
. Exceptions unrelated to validation failures are not converted.This method is intended to be used with the
assert
keyword, like so:assert that(value, name)
.- Parameters:
value
- the value- Returns:
- a validator for the value
-
that
Validates the state of a primitiveboolean
array.The returned validator throws an exception immediately if a validation fails. This exception is then converted into an
AssertionError
. Exceptions unrelated to validation failures are not converted.This method is intended to be used with the
assert
keyword, like so:assert that(value, name)
.- 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
-
that
Validates the state of a primitiveboolean
array.The returned validator throws an exception immediately if a validation fails. This exception is then converted into an
AssertionError
. Exceptions unrelated to validation failures are not converted.This method is intended to be used with the
assert
keyword, like so:assert that(value, name)
.- Parameters:
value
- the value- Returns:
- a validator for the value
- Throws:
NullPointerException
- ifname
is nullIllegalArgumentException
- ifname
contains whitespace or is empty
-
that
Validates the state of a primitivechar
array.The returned validator throws an exception immediately if a validation fails. This exception is then converted into an
AssertionError
. Exceptions unrelated to validation failures are not converted.This method is intended to be used with the
assert
keyword, like so:assert that(value, name)
.- 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
-
that
Validates the state of a primitivechar
array.The returned validator throws an exception immediately if a validation fails. This exception is then converted into an
AssertionError
. Exceptions unrelated to validation failures are not converted.This method is intended to be used with the
assert
keyword, like so:assert that(value, name)
.- Parameters:
value
- the value- Returns:
- a validator for the value
-
that
Validates the state of anObject
array.The returned validator throws an exception immediately if a validation fails. This exception is then converted into an
AssertionError
. Exceptions unrelated to validation failures are not converted.This method is intended to be used with the
assert
keyword, like so:assert that(value, name)
.- 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
-
that
Validates the state of anObject
array.The returned validator throws an exception immediately if a validation fails. This exception is then converted into an
AssertionError
. Exceptions unrelated to validation failures are not converted.This method is intended to be used with the
assert
keyword, like so:assert that(value, name)
.- Type Parameters:
E
- the type of elements in the array- Parameters:
value
- the value- Returns:
- a validator for the value
-
that
Validates the state of aMap
.The returned validator throws an exception immediately if a validation fails. This exception is then converted into an
AssertionError
. Exceptions unrelated to validation failures are not converted.This method is intended to be used with the
assert
keyword, like so:assert that(value, name)
.- 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
-
that
Validates the state of aMap
.The returned validator throws an exception immediately if a validation fails. This exception is then converted into an
AssertionError
. Exceptions unrelated to validation failures are not converted.This method is intended to be used with the
assert
keyword, like so:assert that(value, name)
.- 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 value- Returns:
- a validator for the value
-
that
Validates the state of aPath
.The returned validator throws an exception immediately if a validation fails. This exception is then converted into an
AssertionError
. Exceptions unrelated to validation failures are not converted.This method is intended to be used with the
assert
keyword, like so:assert that(value, name)
.- 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
-
that
Validates the state of aPath
.The returned validator throws an exception immediately if a validation fails. This exception is then converted into an
AssertionError
. Exceptions unrelated to validation failures are not converted.This method is intended to be used with the
assert
keyword, like so:assert that(value, name)
.- Parameters:
value
- the value- Returns:
- a validator for the value
-
that
Validates the state of aString
.The returned validator throws an exception immediately if a validation fails. This exception is then converted into an
AssertionError
. Exceptions unrelated to validation failures are not converted.This method is intended to be used with the
assert
keyword, like so:assert that(value, name)
.- 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
-
that
Validates the state of aString
.The returned validator throws an exception immediately if a validation fails. This exception is then converted into an
AssertionError
. Exceptions unrelated to validation failures are not converted.This method is intended to be used with the
assert
keyword, like so:assert that(value, name)
.- Parameters:
value
- the value- Returns:
- a validator for the value
-
that
Validates the state of aURI
.The returned validator throws an exception immediately if a validation fails. This exception is then converted into an
AssertionError
. Exceptions unrelated to validation failures are not converted.This method is intended to be used with the
assert
keyword, like so:assert that(value, name)
.- 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
-
that
Validates the state of aURI
.The returned validator throws an exception immediately if a validation fails. This exception is then converted into an
AssertionError
. Exceptions unrelated to validation failures are not converted.This method is intended to be used with the
assert
keyword, like so:assert that(value, name)
.- Parameters:
value
- the value- Returns:
- a validator for the value
-
that
Validates the state of aClass
.The returned validator throws an exception immediately if a validation fails. This exception is then converted into an
AssertionError
. Exceptions unrelated to validation failures are not converted.This method is intended to be used with the
assert
keyword, like so:assert that(value, name)
.- Type Parameters:
T
- the type of the class modelled by theClass
object- 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
-
that
Validates the state of aClass
.The returned validator throws an exception immediately if a validation fails. This exception is then converted into an
AssertionError
. Exceptions unrelated to validation failures are not converted.This method is intended to be used with the
assert
keyword, like so:assert that(value, name)
.- Type Parameters:
T
- the type of the class modelled by theClass
object- Parameters:
value
- the value- Returns:
- a validator for the value
-
that
Validates the state of anOptional
.The returned validator throws an exception immediately if a validation fails. This exception is then converted into an
AssertionError
. Exceptions unrelated to validation failures are not converted.This method is intended to be used with the
assert
keyword, like so:assert that(value, name)
.- 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
-
that
Validates the state of anOptional
.The returned validator throws an exception immediately if a validation fails. This exception is then converted into an
AssertionError
. Exceptions unrelated to validation failures are not converted.This method is intended to be used with the
assert
keyword, like so:assert that(value, name)
.- Type Parameters:
T
- the type of optional- Parameters:
value
- the value- Returns:
- a validator for the value
-
that
Validates the state of anInetAddress
.The returned validator throws an exception immediately if a validation fails. This exception is then converted into an
AssertionError
. Exceptions unrelated to validation failures are not converted.This method is intended to be used with the
assert
keyword, like so:assert that(value, name)
.- 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
-
that
Validates the state of anInetAddress
.The returned validator throws an exception immediately if a validation fails. This exception is then converted into an
AssertionError
. Exceptions unrelated to validation failures are not converted.This method is intended to be used with the
assert
keyword, like so:assert that(value, name)
.- Parameters:
value
- the value- Returns:
- a validator for the value
-
checkIf
Validates the state of abyte
.The returned validator captures exceptions on validation failure rather than throwing them immediately. These exceptions can be retrieved or thrown once the validation completes. Exceptions unrelated to validation failures are thrown immediately.
- 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
-
checkIf
Validates the state of abyte
The returned validator captures exceptions on validation failure rather than throwing them immediately. These exceptions can be retrieved or thrown once the validation completes. Exceptions unrelated to validation failures are thrown immediately.
- Parameters:
value
- the value- Returns:
- a validator for the value
-
checkIf
Validates the state of aByte
The returned validator captures exceptions on validation failure rather than throwing them immediately. These exceptions can be retrieved or thrown once the validation completes. Exceptions unrelated to validation failures are thrown immediately.
- 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
-
checkIf
Validates the state of aByte
The returned validator captures exceptions on validation failure rather than throwing them immediately. These exceptions can be retrieved or thrown once the validation completes. Exceptions unrelated to validation failures are thrown immediately.
- Parameters:
value
- the value- Returns:
- a validator for the value
-
checkIf
Validates the state of ashort
The returned validator captures exceptions on validation failure rather than throwing them immediately. These exceptions can be retrieved or thrown once the validation completes. Exceptions unrelated to validation failures are thrown immediately.
- 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
-
checkIf
Validates the state of ashort
The returned validator captures exceptions on validation failure rather than throwing them immediately. These exceptions can be retrieved or thrown once the validation completes. Exceptions unrelated to validation failures are thrown immediately.
- Parameters:
value
- the value- Returns:
- a validator for the value
-
checkIf
Validates the state of aShort
The returned validator captures exceptions on validation failure rather than throwing them immediately. These exceptions can be retrieved or thrown once the validation completes. Exceptions unrelated to validation failures are thrown immediately.
- 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
-
checkIf
Validates the state of aShort
The returned validator captures exceptions on validation failure rather than throwing them immediately. These exceptions can be retrieved or thrown once the validation completes. Exceptions unrelated to validation failures are thrown immediately.
- Parameters:
value
- the value- Returns:
- a validator for the value
-
checkIf
Validates the state of anint
The returned validator captures exceptions on validation failure rather than throwing them immediately. These exceptions can be retrieved or thrown once the validation completes. Exceptions unrelated to validation failures are thrown immediately.
- 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
-
checkIf
Validates the state of anint
The returned validator captures exceptions on validation failure rather than throwing them immediately. These exceptions can be retrieved or thrown once the validation completes. Exceptions unrelated to validation failures are thrown immediately.
- Parameters:
value
- the value- Returns:
- a validator for the value
-
checkIf
Validates the state of anInteger
The returned validator captures exceptions on validation failure rather than throwing them immediately. These exceptions can be retrieved or thrown once the validation completes. Exceptions unrelated to validation failures are thrown immediately.
- 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
-
checkIf
Validates the state of anInteger
The returned validator captures exceptions on validation failure rather than throwing them immediately. These exceptions can be retrieved or thrown once the validation completes. Exceptions unrelated to validation failures are thrown immediately.
- Parameters:
value
- the value- Returns:
- a validator for the value
-
checkIf
Validates the state of along
The returned validator captures exceptions on validation failure rather than throwing them immediately. These exceptions can be retrieved or thrown once the validation completes. Exceptions unrelated to validation failures are thrown immediately.
- 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
-
checkIf
Validates the state of along
The returned validator captures exceptions on validation failure rather than throwing them immediately. These exceptions can be retrieved or thrown once the validation completes. Exceptions unrelated to validation failures are thrown immediately.
- Parameters:
value
- the value- Returns:
- a validator for the value
-
checkIf
Validates the state of aLong
The returned validator captures exceptions on validation failure rather than throwing them immediately. These exceptions can be retrieved or thrown once the validation completes. Exceptions unrelated to validation failures are thrown immediately.
- 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
-
checkIf
Validates the state of aLong
The returned validator captures exceptions on validation failure rather than throwing them immediately. These exceptions can be retrieved or thrown once the validation completes. Exceptions unrelated to validation failures are thrown immediately.
- Parameters:
value
- the value- Returns:
- a validator for the value
-
checkIf
Validates the state of afloat
The returned validator captures exceptions on validation failure rather than throwing them immediately. These exceptions can be retrieved or thrown once the validation completes. Exceptions unrelated to validation failures are thrown immediately.
- 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
-
checkIf
Validates the state of afloat
The returned validator captures exceptions on validation failure rather than throwing them immediately. These exceptions can be retrieved or thrown once the validation completes. Exceptions unrelated to validation failures are thrown immediately.
- Parameters:
value
- the value- Returns:
- a validator for the value
-
checkIf
Validates the state of aFloat
The returned validator captures exceptions on validation failure rather than throwing them immediately. These exceptions can be retrieved or thrown once the validation completes. Exceptions unrelated to validation failures are thrown immediately.
- 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
-
checkIf
Validates the state of aFloat
The returned validator captures exceptions on validation failure rather than throwing them immediately. These exceptions can be retrieved or thrown once the validation completes. Exceptions unrelated to validation failures are thrown immediately.
- Parameters:
value
- the value- Returns:
- a validator for the value
-
checkIf
Validates the state of adouble
The returned validator captures exceptions on validation failure rather than throwing them immediately. These exceptions can be retrieved or thrown once the validation completes. Exceptions unrelated to validation failures are thrown immediately.
- 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
-
checkIf
Validates the state of adouble
The returned validator captures exceptions on validation failure rather than throwing them immediately. These exceptions can be retrieved or thrown once the validation completes. Exceptions unrelated to validation failures are thrown immediately.
- Parameters:
value
- the value- Returns:
- a validator for the value
-
checkIf
Validates the state of aDouble
The returned validator captures exceptions on validation failure rather than throwing them immediately. These exceptions can be retrieved or thrown once the validation completes. Exceptions unrelated to validation failures are thrown immediately.
- 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
-
checkIf
Validates the state of aDouble
The returned validator captures exceptions on validation failure rather than throwing them immediately. These exceptions can be retrieved or thrown once the validation completes. Exceptions unrelated to validation failures are thrown immediately.
- Parameters:
value
- the value- Returns:
- a validator for the value
-
checkIf
Validates the state of aboolean
The returned validator captures exceptions on validation failure rather than throwing them immediately. These exceptions can be retrieved or thrown once the validation completes. Exceptions unrelated to validation failures are thrown immediately.
- 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
-
checkIf
Validates the state of aboolean
The returned validator captures exceptions on validation failure rather than throwing them immediately. These exceptions can be retrieved or thrown once the validation completes. Exceptions unrelated to validation failures are thrown immediately.
- Parameters:
value
- the value- Returns:
- a validator for the value
-
checkIf
Validates the state of aBoolean
The returned validator captures exceptions on validation failure rather than throwing them immediately. These exceptions can be retrieved or thrown once the validation completes. Exceptions unrelated to validation failures are thrown immediately.
- 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
-
checkIf
Validates the state of aBoolean
The returned validator captures exceptions on validation failure rather than throwing them immediately. These exceptions can be retrieved or thrown once the validation completes. Exceptions unrelated to validation failures are thrown immediately.
- Parameters:
value
- the value- Returns:
- a validator for the value
-
checkIf
Validates the state of achar
The returned validator captures exceptions on validation failure rather than throwing them immediately. These exceptions can be retrieved or thrown once the validation completes. Exceptions unrelated to validation failures are thrown immediately.
- 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
-
checkIf
Validates the state of achar
The returned validator captures exceptions on validation failure rather than throwing them immediately. These exceptions can be retrieved or thrown once the validation completes. Exceptions unrelated to validation failures are thrown immediately.
- Parameters:
value
- the value- Returns:
- a validator for the value
-
checkIf
Validates the state of aCharacter
The returned validator captures exceptions on validation failure rather than throwing them immediately. These exceptions can be retrieved or thrown once the validation completes. Exceptions unrelated to validation failures are thrown immediately.
- 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
-
checkIf
Validates the state of aCharacter
The returned validator captures exceptions on validation failure rather than throwing them immediately. These exceptions can be retrieved or thrown once the validation completes. Exceptions unrelated to validation failures are thrown immediately.
- Parameters:
value
- the value- Returns:
- a validator for the value
-
checkIf
Validates the state of aBigInteger
The returned validator captures exceptions on validation failure rather than throwing them immediately. These exceptions can be retrieved or thrown once the validation completes. Exceptions unrelated to validation failures are thrown immediately.
- 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
-
checkIf
Validates the state of aBigInteger
The returned validator captures exceptions on validation failure rather than throwing them immediately. These exceptions can be retrieved or thrown once the validation completes. Exceptions unrelated to validation failures are thrown immediately.
- Parameters:
value
- the value- Returns:
- a validator for the value
-
checkIf
Validates the state of aBigDecimal
The returned validator captures exceptions on validation failure rather than throwing them immediately. These exceptions can be retrieved or thrown once the validation completes. Exceptions unrelated to validation failures are thrown immediately.
- 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
-
checkIf
Validates the state of aBigDecimal
The returned validator captures exceptions on validation failure rather than throwing them immediately. These exceptions can be retrieved or thrown once the validation completes. Exceptions unrelated to validation failures are thrown immediately.
- Parameters:
value
- the value- Returns:
- a validator for the value
-
checkIf
Validates the state of aComparable
object.The returned validator captures exceptions on validation failure rather than throwing them immediately. These exceptions can be retrieved or thrown once the validation completes. Exceptions unrelated to validation failures are thrown immediately.
- 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
-
checkIf
Validates the state of aComparable
object.The returned validator captures exceptions on validation failure rather than throwing them immediately. These exceptions can be retrieved or thrown once the validation completes. Exceptions unrelated to validation failures are thrown immediately.
- Type Parameters:
T
- the type of the value- Parameters:
value
- the value- Returns:
- a validator for the value
-
checkIf
Validates the state of anObject
The returned validator captures exceptions on validation failure rather than throwing them immediately. These exceptions can be retrieved or thrown once the validation completes. Exceptions unrelated to validation failures are thrown immediately.
- 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
-
checkIf
Validates the state of anObject
The returned validator captures exceptions on validation failure rather than throwing them immediately. These exceptions can be retrieved or thrown once the validation completes. Exceptions unrelated to validation failures are thrown immediately.
- Type Parameters:
T
- the type of the value- Parameters:
value
- the value- Returns:
- a validator for the value
-
checkIf
Validates the state of aCollection
The returned validator captures exceptions on validation failure rather than throwing them immediately. These exceptions can be retrieved or thrown once the validation completes. Exceptions unrelated to validation failures are thrown immediately.
- 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
-
checkIf
Validates the state of aCollection
The returned validator captures exceptions on validation failure rather than throwing them immediately. These exceptions can be retrieved or thrown once the validation completes. Exceptions unrelated to validation failures are thrown immediately.
- Type Parameters:
T
- the type of the valueE
- the type of elements in the collection- Parameters:
value
- the value- Returns:
- a validator for the value
-
checkIf
Validates the state of aList
The returned validator captures exceptions on validation failure rather than throwing them immediately. These exceptions can be retrieved or thrown once the validation completes. Exceptions unrelated to validation failures are thrown immediately.
- 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
-
checkIf
Validates the state of aList
The returned validator captures exceptions on validation failure rather than throwing them immediately. These exceptions can be retrieved or thrown once the validation completes. Exceptions unrelated to validation failures are thrown immediately.
- Type Parameters:
T
- the type of the valueE
- the type of elements in the list- Parameters:
value
- the value- Returns:
- a validator for the value
-
checkIf
Validates the state of a primitivebyte
array.The returned validator captures exceptions on validation failure rather than throwing them immediately. These exceptions can be retrieved or thrown once the validation completes. Exceptions unrelated to validation failures are thrown immediately.
- 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
-
checkIf
Validates the state of a primitivebyte
array.The returned validator captures exceptions on validation failure rather than throwing them immediately. These exceptions can be retrieved or thrown once the validation completes. Exceptions unrelated to validation failures are thrown immediately.
- Parameters:
value
- the value- Returns:
- a validator for the value
-
checkIf
Validates the state of a primitiveshort
array.The returned validator captures exceptions on validation failure rather than throwing them immediately. These exceptions can be retrieved or thrown once the validation completes. Exceptions unrelated to validation failures are thrown immediately.
- 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
-
checkIf
Validates the state of a primitiveshort
array.The returned validator captures exceptions on validation failure rather than throwing them immediately. These exceptions can be retrieved or thrown once the validation completes. Exceptions unrelated to validation failures are thrown immediately.
- Parameters:
value
- the value- Returns:
- a validator for the value
-
checkIf
Validates the state of a primitiveint
array.The returned validator captures exceptions on validation failure rather than throwing them immediately. These exceptions can be retrieved or thrown once the validation completes. Exceptions unrelated to validation failures are thrown immediately.
- 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
-
checkIf
Validates the state of a primitiveint
array.The returned validator captures exceptions on validation failure rather than throwing them immediately. These exceptions can be retrieved or thrown once the validation completes. Exceptions unrelated to validation failures are thrown immediately.
- Parameters:
value
- the value- Returns:
- a validator for the value
-
checkIf
Validates the state of a primitivelong
array.The returned validator captures exceptions on validation failure rather than throwing them immediately. These exceptions can be retrieved or thrown once the validation completes. Exceptions unrelated to validation failures are thrown immediately.
- 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
-
checkIf
Validates the state of a primitivelong
array.The returned validator captures exceptions on validation failure rather than throwing them immediately. These exceptions can be retrieved or thrown once the validation completes. Exceptions unrelated to validation failures are thrown immediately.
- Parameters:
value
- the value- Returns:
- a validator for the value
-
checkIf
Validates the state of a primitivefloat
array.The returned validator captures exceptions on validation failure rather than throwing them immediately. These exceptions can be retrieved or thrown once the validation completes. Exceptions unrelated to validation failures are thrown immediately.
- 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
-
checkIf
Validates the state of a primitivefloat
array.The returned validator captures exceptions on validation failure rather than throwing them immediately. These exceptions can be retrieved or thrown once the validation completes. Exceptions unrelated to validation failures are thrown immediately.
- Parameters:
value
- the value- Returns:
- a validator for the value
-
checkIf
Validates the state of a primitivedouble
array.The returned validator captures exceptions on validation failure rather than throwing them immediately. These exceptions can be retrieved or thrown once the validation completes. Exceptions unrelated to validation failures are thrown immediately.
- 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
-
checkIf
Validates the state of a primitivedouble
array.The returned validator captures exceptions on validation failure rather than throwing them immediately. These exceptions can be retrieved or thrown once the validation completes. Exceptions unrelated to validation failures are thrown immediately.
- Parameters:
value
- the value- Returns:
- a validator for the value
-
checkIf
Validates the state of a primitiveboolean
array.The returned validator captures exceptions on validation failure rather than throwing them immediately. These exceptions can be retrieved or thrown once the validation completes. Exceptions unrelated to validation failures are thrown immediately.
- 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
-
checkIf
Validates the state of a primitiveboolean
array.The returned validator captures exceptions on validation failure rather than throwing them immediately. These exceptions can be retrieved or thrown once the validation completes. Exceptions unrelated to validation failures are thrown immediately.
- Parameters:
value
- the value- Returns:
- a validator for the value
-
checkIf
Validates the state of a primitivechar
array.The returned validator captures exceptions on validation failure rather than throwing them immediately. These exceptions can be retrieved or thrown once the validation completes. Exceptions unrelated to validation failures are thrown immediately.
- 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
-
checkIf
Validates the state of a primitivechar
array.The returned validator captures exceptions on validation failure rather than throwing them immediately. These exceptions can be retrieved or thrown once the validation completes. Exceptions unrelated to validation failures are thrown immediately.
- Parameters:
value
- the value- Returns:
- a validator for the value
-
checkIf
Validates the state of anObject
array.The returned validator captures exceptions on validation failure rather than throwing them immediately. These exceptions can be retrieved or thrown once the validation completes. Exceptions unrelated to validation failures are thrown immediately.
- 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
-
checkIf
Validates the state of anObject
array.The returned validator captures exceptions on validation failure rather than throwing them immediately. These exceptions can be retrieved or thrown once the validation completes. Exceptions unrelated to validation failures are thrown immediately.
- Type Parameters:
E
- the type of elements in the array- Parameters:
value
- the value- Returns:
- a validator for the value
-
checkIf
Validates the state of aMap
.The returned validator captures exceptions on validation failure rather than throwing them immediately. These exceptions can be retrieved or thrown once the validation completes. Exceptions unrelated to validation failures are thrown immediately.
- 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
-
checkIf
Validates the state of aMap
.The returned validator captures exceptions on validation failure rather than throwing them immediately. These exceptions can be retrieved or thrown once the validation completes. Exceptions unrelated to validation failures are thrown immediately.
- 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 value- Returns:
- a validator for the value
-
checkIf
Validates the state of aPath
.The returned validator captures exceptions on validation failure rather than throwing them immediately. These exceptions can be retrieved or thrown once the validation completes. Exceptions unrelated to validation failures are thrown immediately.
- 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
-
checkIf
Validates the state of aPath
.The returned validator captures exceptions on validation failure rather than throwing them immediately. These exceptions can be retrieved or thrown once the validation completes. Exceptions unrelated to validation failures are thrown immediately.
- Parameters:
value
- the value- Returns:
- a validator for the value
-
checkIf
Validates the state of aString
.The returned validator captures exceptions on validation failure rather than throwing them immediately. These exceptions can be retrieved or thrown once the validation completes. Exceptions unrelated to validation failures are thrown immediately.
- 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
-
checkIf
Validates the state of aString
.The returned validator captures exceptions on validation failure rather than throwing them immediately. These exceptions can be retrieved or thrown once the validation completes. Exceptions unrelated to validation failures are thrown immediately.
- Parameters:
value
- the value- Returns:
- a validator for the value
-
checkIf
Validates the state of aURI
.The returned validator captures exceptions on validation failure rather than throwing them immediately. These exceptions can be retrieved or thrown once the validation completes. Exceptions unrelated to validation failures are thrown immediately.
- 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
-
checkIf
Validates the state of aURI
.The returned validator captures exceptions on validation failure rather than throwing them immediately. These exceptions can be retrieved or thrown once the validation completes. Exceptions unrelated to validation failures are thrown immediately.
- Parameters:
value
- the value- Returns:
- a validator for the value
-
checkIf
Validates the state of aClass
.The returned validator captures exceptions on validation failure rather than throwing them immediately. These exceptions can be retrieved or thrown once the validation completes. Exceptions unrelated to validation failures are thrown immediately.
- Type Parameters:
T
- the type of the class modelled by theClass
object- 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
-
checkIf
Validates the state of aClass
.The returned validator captures exceptions on validation failure rather than throwing them immediately. These exceptions can be retrieved or thrown once the validation completes. Exceptions unrelated to validation failures are thrown immediately.
- Type Parameters:
T
- the type of the class modelled by theClass
object- Parameters:
value
- the value- Returns:
- a validator for the value
-
checkIf
Validates the state of anOptional
.The returned validator captures exceptions on validation failure rather than throwing them immediately. These exceptions can be retrieved or thrown once the validation completes. Exceptions unrelated to validation failures are thrown immediately.
- Type Parameters:
T
- the type of the class modelled by theClass
object- 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
-
checkIf
Validates the state of anOptional
.The returned validator captures exceptions on validation failure rather than throwing them immediately. These exceptions can be retrieved or thrown once the validation completes. Exceptions unrelated to validation failures are thrown immediately.
- Type Parameters:
T
- the type of the class modelled by theClass
object- Parameters:
value
- the value- Returns:
- a validator for the value
-
checkIf
Validates the state of anInetAddress
.The returned validator captures exceptions on validation failure rather than throwing them immediately. These exceptions can be retrieved or thrown once the validation completes. Exceptions unrelated to validation failures are thrown immediately.
- 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
-
checkIf
Validates the state of anInetAddress
.The returned validator captures exceptions on validation failure rather than throwing them immediately. These exceptions can be retrieved or thrown once the validation completes. Exceptions unrelated to validation failures are thrown immediately.
- Parameters:
value
- the value- Returns:
- a validator for the value
-
getContext
Returns the contextual information for validators created out by this factory. The contextual information is a map of key-value pairs that can provide more details about validation failures. For example, if the message is "Password may not be empty" and the map contains the key-value pair{"username": "john.smith"}
, the exception message would be:Password may not be empty username: john.smith
Note that values are wrapped in an
Optional
because modern maps do not supportnull
values.- Returns:
- an unmodifiable map from each entry's name to its value
-
withContext
Sets the contextual information for validators created by this factory.This method adds contextual information to exception messages. The contextual information is stored as key-value pairs in a map. Values set by this method may be overridden by
ValidatorComponent.withContext(Object, String)
}.- Parameters:
value
- the value of the entryname
- the name of an entry- Returns:
- the underlying validator factory
- Throws:
NullPointerException
- ifname
is nullIllegalArgumentException
- ifname
:- contains whitespace
- is empty
- is already in use by the value being validated or the validator context
-
removeContext
Removes the contextual information of validators created by this factory.- Parameters:
name
- the parameter name- Returns:
- the underlying validator factory
- Throws:
NullPointerException
- ifname
is nullIllegalArgumentException
- ifname
:- contains whitespace
- is empty
-
globalConfiguration
Returns the global configuration shared by all validators.NOTE: Updating this configuration affects existing and new validators.
- Returns:
- the global configuration updater
-