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 PrimitiveBooleanValidatorcheckIf(boolean value) Validates the state of abooleancheckIf(boolean[] value) Validates the state of a primitivebooleanarray.Validates the state of a primitivebooleanarray.static PrimitiveBooleanValidatorValidates the state of abooleanstatic PrimitiveByteValidatorcheckIf(byte value) Validates the state of abytestatic PrimitiveByteArrayValidatorcheckIf(byte[] value) Validates the state of a primitivebytearray.static PrimitiveByteArrayValidatorValidates the state of a primitivebytearray.static PrimitiveByteValidatorValidates the state of abyte.static PrimitiveCharacterValidatorcheckIf(char value) Validates the state of acharcheckIf(char[] value) Validates the state of a primitivechararray.Validates the state of a primitivechararray.static PrimitiveCharacterValidatorValidates the state of acharstatic PrimitiveDoubleValidatorcheckIf(double value) Validates the state of adoublecheckIf(double[] value) Validates the state of a primitivedoublearray.Validates the state of a primitivedoublearray.static PrimitiveDoubleValidatorValidates the state of adoublestatic PrimitiveFloatValidatorcheckIf(float value) Validates the state of afloatstatic PrimitiveFloatArrayValidatorcheckIf(float[] value) Validates the state of a primitivefloatarray.static PrimitiveFloatArrayValidatorValidates the state of a primitivefloatarray.static PrimitiveFloatValidatorValidates the state of afloatstatic PrimitiveIntegerValidatorcheckIf(int value) Validates the state of anintcheckIf(int[] value) Validates the state of a primitiveintarray.Validates the state of a primitiveintarray.static PrimitiveIntegerValidatorValidates the state of anintstatic PrimitiveLongValidatorcheckIf(long value) Validates the state of alongstatic PrimitiveLongArrayValidatorcheckIf(long[] value) Validates the state of a primitivelongarray.static PrimitiveLongArrayValidatorValidates the state of a primitivelongarray.static PrimitiveLongValidatorValidates the state of alongstatic PrimitiveShortValidatorcheckIf(short value) Validates the state of ashortstatic PrimitiveShortArrayValidatorcheckIf(short[] value) Validates the state of a primitiveshortarray.static PrimitiveShortArrayValidatorValidates the state of a primitiveshortarray.static PrimitiveShortValidatorValidates the state of ashortstatic <E> ObjectArrayValidator<E[], E> checkIf(E[] value) Validates the state of anObjectarray.static <E> ObjectArrayValidator<E[], E> Validates the state of anObjectarray.static BooleanValidatorValidates the state of aBooleanstatic BooleanValidatorValidates the state of aBooleanstatic ByteValidatorValidates the state of aBytestatic ByteValidatorValidates the state of aBytestatic CharacterValidatorValidates the state of aCharacterstatic CharacterValidatorValidates the state of aCharacterstatic <T> GenericTypeValidator<T> Validates the state of aClass.static <T> GenericTypeValidator<T> Validates the state of aClass.static DoubleValidatorValidates the state of aDoublestatic DoubleValidatorValidates the state of aDoublestatic FloatValidatorValidates the state of aFloatstatic FloatValidatorValidates the state of aFloatstatic IntegerValidatorValidates the state of anIntegerstatic IntegerValidatorValidates the state of anIntegerstatic LongValidatorValidates the state of aLongstatic LongValidatorValidates the state of aLongstatic ShortValidatorValidates the state of aShortstatic ShortValidatorValidates the state of aShortstatic StringValidatorValidates the state of aString.static StringValidatorValidates the state of aString.static BigDecimalValidatorcheckIf(BigDecimal value) Validates the state of aBigDecimalstatic BigDecimalValidatorcheckIf(BigDecimal value, String name) Validates the state of aBigDecimalstatic BigIntegerValidatorcheckIf(BigInteger value) Validates the state of aBigIntegerstatic BigIntegerValidatorcheckIf(BigInteger value, String name) Validates the state of aBigIntegerstatic InetAddressValidatorcheckIf(InetAddress value) Validates the state of anInetAddress.static InetAddressValidatorcheckIf(InetAddress value, String name) Validates the state of anInetAddress.static UriValidatorValidates the state of aURI.static UriValidatorValidates the state of aURI.static PathValidatorValidates the state of aPath.static PathValidatorValidates 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 aComparableobject.static <T extends Comparable<T>>
ComparableValidator<T> Validates the state of aComparableobject.Returns the contextual information for validators created out by this factory.static GlobalConfigurationReturns the global configuration shared by all validators.static JavaValidatorsremoveContext(String name) Removes the contextual information of validators created by this factory.requireThat(boolean[] value, String name) Validates the state of a primitivebooleanarray.static PrimitiveBooleanValidatorrequireThat(boolean value, String name) Validates the state of aboolean.static PrimitiveByteArrayValidatorrequireThat(byte[] value, String name) Validates the state of a primitivebytearray.static PrimitiveByteValidatorrequireThat(byte value, String name) Validates the state of abyte.requireThat(char[] value, String name) Validates the state of a primitivechararray.static PrimitiveCharacterValidatorrequireThat(char value, String name) Validates the state of achar.requireThat(double[] value, String name) Validates the state of a primitivedoublearray.static PrimitiveDoubleValidatorrequireThat(double value, String name) Validates the state of adouble.static PrimitiveFloatArrayValidatorrequireThat(float[] value, String name) Validates the state of a primitivefloatarray.static PrimitiveFloatValidatorrequireThat(float value, String name) Validates the state of afloat.requireThat(int[] value, String name) Validates the state of a primitiveintarray.static PrimitiveIntegerValidatorrequireThat(int value, String name) Validates the state of anint.static PrimitiveLongArrayValidatorrequireThat(long[] value, String name) Validates the state of a primitivelongarray.static PrimitiveLongValidatorrequireThat(long value, String name) Validates the state of along.static PrimitiveShortArrayValidatorrequireThat(short[] value, String name) Validates the state of a primitiveshortarray.static PrimitiveShortValidatorrequireThat(short value, String name) Validates the state of ashort.static <E> ObjectArrayValidator<E[], E> requireThat(E[] value, String name) Validates the state of anObjectarray.static BooleanValidatorrequireThat(Boolean value, String name) Validates the state of aBoolean.static ByteValidatorrequireThat(Byte value, String name) Validates the state of aByte.static CharacterValidatorrequireThat(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 DoubleValidatorrequireThat(Double value, String name) Validates the state of aDouble.static FloatValidatorrequireThat(Float value, String name) Validates the state of aFloat.static IntegerValidatorrequireThat(Integer value, String name) Validates the state of anInteger.static LongValidatorrequireThat(Long value, String name) Validates the state of aLong.static ShortValidatorrequireThat(Short value, String name) Validates the state of aShort.static StringValidatorrequireThat(String value, String name) Validates the state of aString.static BigDecimalValidatorrequireThat(BigDecimal value, String name) Validates the state of aBigDecimal.static BigIntegerValidatorrequireThat(BigInteger value, String name) Validates the state of aBigInteger.static InetAddressValidatorrequireThat(InetAddress value, String name) Validates the state of anInetAddress.static UriValidatorrequireThat(URI value, String name) Validates the state of aURI.static PathValidatorrequireThat(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 aComparableobject.static PrimitiveBooleanValidatorthat(boolean value) Validates the state of aboolean.that(boolean[] value) Validates the state of a primitivebooleanarray.Validates the state of a primitivebooleanarray.static PrimitiveBooleanValidatorValidates the state of aboolean.static PrimitiveByteValidatorthat(byte value) Validates the state of abyte.static PrimitiveByteArrayValidatorthat(byte[] value) Validates the state of a primitivebytearray.static PrimitiveByteArrayValidatorValidates the state of a primitivebytearray.static PrimitiveByteValidatorValidates the state of abyte.static PrimitiveCharacterValidatorthat(char value) Validates the state of achar.that(char[] value) Validates the state of a primitivechararray.Validates the state of a primitivechararray.static PrimitiveCharacterValidatorValidates the state of achar.static PrimitiveDoubleValidatorthat(double value) Validates the state of adouble.that(double[] value) Validates the state of a primitivedoublearray.Validates the state of a primitivedoublearray.static PrimitiveDoubleValidatorValidates the state of adouble.static PrimitiveFloatValidatorthat(float value) Validates the state of afloat.static PrimitiveFloatArrayValidatorthat(float[] value) Validates the state of a primitivefloatarray.static PrimitiveFloatArrayValidatorValidates the state of a primitivefloatarray.static PrimitiveFloatValidatorValidates the state of afloat.static PrimitiveIntegerValidatorthat(int value) Validates the state of anint.that(int[] value) Validates the state of a primitiveintarray.Validates the state of a primitiveintarray.static PrimitiveIntegerValidatorValidates the state of anint.static PrimitiveLongValidatorthat(long value) Validates the state of along.static PrimitiveLongArrayValidatorthat(long[] value) Validates the state of a primitivelongarray.static PrimitiveLongArrayValidatorValidates the state of a primitivelongarray.static PrimitiveLongValidatorValidates the state of along.static PrimitiveShortValidatorthat(short value) Validates the state of ashort.static PrimitiveShortArrayValidatorthat(short[] value) Validates the state of a primitiveshortarray.static PrimitiveShortArrayValidatorValidates the state of a primitiveshortarray.static PrimitiveShortValidatorValidates the state of ashort.static <E> ObjectArrayValidator<E[], E> that(E[] value) Validates the state of anObjectarray.static <E> ObjectArrayValidator<E[], E> Validates the state of anObjectarray.static BooleanValidatorValidates the state of aBoolean.static BooleanValidatorValidates the state of aBoolean.static ByteValidatorValidates the state of aByte.static ByteValidatorValidates the state of aByte.static CharacterValidatorValidates the state of aCharacter.static CharacterValidatorValidates the state of aCharacter.static <T> GenericTypeValidator<T> Validates the state of aClass.static <T> GenericTypeValidator<T> Validates the state of aClass.static DoubleValidatorValidates the state of aDouble.static DoubleValidatorValidates the state of aDouble.static FloatValidatorValidates the state of aFloat.static FloatValidatorValidates the state of aFloat.static IntegerValidatorValidates the state of anInteger.static IntegerValidatorValidates the state of anInteger.static LongValidatorValidates the state of aLong.static LongValidatorValidates the state of aLong.static ShortValidatorValidates the state of aShort.static ShortValidatorValidates the state of aShort.static StringValidatorValidates the state of aString.static StringValidatorValidates the state of aString.static BigDecimalValidatorthat(BigDecimal value) Validates the state of aBigDecimal.static BigDecimalValidatorthat(BigDecimal value, String name) Validates the state of aBigDecimal.static BigIntegerValidatorthat(BigInteger value) Validates the state of aBigInteger.static BigIntegerValidatorthat(BigInteger value, String name) Validates the state of aBigInteger.static InetAddressValidatorthat(InetAddress value) Validates the state of anInetAddress.static InetAddressValidatorthat(InetAddress value, String name) Validates the state of anInetAddress.static UriValidatorValidates the state of aURI.static UriValidatorValidates the state of aURI.static PathValidatorValidates the state of aPath.static PathValidatorValidates 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 aComparableobject.static <T extends Comparable<T>>
ComparableValidator<T> Validates the state of aComparableobject.static JavaValidatorswithContext(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- ifnameis nullIllegalArgumentException- ifnamecontains 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- ifnameis nullIllegalArgumentException- ifnamecontains 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- ifnameis nullIllegalArgumentException- ifnamecontains 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- ifnameis nullIllegalArgumentException- ifnamecontains 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- ifnameis nullIllegalArgumentException- ifnamecontains 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- ifnameis nullIllegalArgumentException- ifnamecontains 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- ifnameis nullIllegalArgumentException- ifnamecontains 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- ifnameis nullIllegalArgumentException- ifnamecontains 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- ifnameis nullIllegalArgumentException- ifnamecontains 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- ifnameis nullIllegalArgumentException- ifnamecontains 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- ifnameis nullIllegalArgumentException- ifnamecontains 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- ifnameis nullIllegalArgumentException- ifnamecontains 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- ifnameis nullIllegalArgumentException- ifnamecontains 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- ifnameis nullIllegalArgumentException- ifnamecontains 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- ifnameis nullIllegalArgumentException- ifnamecontains 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- ifnameis nullIllegalArgumentException- ifnamecontains 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- ifnameis nullIllegalArgumentException- ifnamecontains 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- ifnameis nullIllegalArgumentException- ifnamecontains whitespace or is empty
-
requireThat
Validates the state of aComparableobject.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- ifnameis nullIllegalArgumentException- ifnamecontains 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- ifnameis nullIllegalArgumentException- ifnamecontains 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- ifnameis nullIllegalArgumentException- ifnamecontains 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- ifnameis nullIllegalArgumentException- ifnamecontains whitespace or is empty
-
requireThat
Validates the state of a primitivebytearray.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- ifnameis nullIllegalArgumentException- ifnamecontains whitespace or is empty
-
requireThat
Validates the state of a primitiveshortarray.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- ifnameis nullIllegalArgumentException- ifnamecontains whitespace or is empty
-
requireThat
Validates the state of a primitiveintarray.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- ifnameis nullIllegalArgumentException- ifnamecontains whitespace or is empty
-
requireThat
Validates the state of a primitivelongarray.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- ifnameis nullIllegalArgumentException- ifnamecontains whitespace or is empty
-
requireThat
Validates the state of a primitivefloatarray.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- ifnameis nullIllegalArgumentException- ifnamecontains whitespace or is empty
-
requireThat
Validates the state of a primitivedoublearray.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- ifnameis nullIllegalArgumentException- ifnamecontains whitespace or is empty
-
requireThat
Validates the state of a primitivebooleanarray.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- ifnameis nullIllegalArgumentException- ifnamecontains whitespace or is empty
-
requireThat
Validates the state of a primitivechararray.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- ifnameis nullIllegalArgumentException- ifnamecontains whitespace or is empty
-
requireThat
Validates the state of anObjectarray.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- ifnameis nullIllegalArgumentException- ifnamecontains 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- ifnameis nullIllegalArgumentException- ifnamecontains 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- ifnameis nullIllegalArgumentException- ifnamecontains 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- ifnameis nullIllegalArgumentException- ifnamecontains 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- ifnameis nullIllegalArgumentException- ifnamecontains 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 theClassobject- Parameters:
value- the valuename- the name of the value- Returns:
- a validator for the value
- Throws:
NullPointerException- ifnameis nullIllegalArgumentException- ifnamecontains 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- ifnameis nullIllegalArgumentException- ifnamecontains 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- ifnameis nullIllegalArgumentException- ifnamecontains 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
AssertionErrorand 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
assertkeyword, like so:assert that(value, name).- Parameters:
value- the valuename- the name of the value- Returns:
- a validator for the value
- Throws:
NullPointerException- ifnameis nullIllegalArgumentException- ifnamecontains 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
AssertionErrorand 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
assertkeyword, 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
AssertionErrorand 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
assertkeyword, like so:assert that(value, name).- Parameters:
value- the valuename- the name of the value- Returns:
- a validator for the value
- Throws:
NullPointerException- ifnameis nullIllegalArgumentException- ifnamecontains 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
AssertionErrorand 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
assertkeyword, 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
AssertionErrorand 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
assertkeyword, like so:assert that(value, name).- Parameters:
value- the valuename- the name of the value- Returns:
- a validator for the value
- Throws:
NullPointerException- ifnameis nullIllegalArgumentException- ifnamecontains 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
AssertionErrorand 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
assertkeyword, 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
AssertionErrorand 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
assertkeyword, like so:assert that(value, name).- Parameters:
value- the valuename- the name of the value- Returns:
- a validator for the value
- Throws:
NullPointerException- ifnameis nullIllegalArgumentException- ifnamecontains 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
AssertionErrorand 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
assertkeyword, 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
AssertionErrorand 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
assertkeyword, like so:assert that(value, name).- Parameters:
value- the valuename- the name of the value- Returns:
- a validator for the value
- Throws:
NullPointerException- ifnameis nullIllegalArgumentException- ifnamecontains 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
AssertionErrorand 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
assertkeyword, 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
AssertionErrorand 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
assertkeyword, like so:assert that(value, name).- Parameters:
value- the valuename- the name of the value- Returns:
- a validator for the value
- Throws:
NullPointerException- ifnameis nullIllegalArgumentException- ifnamecontains 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
AssertionErrorand 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
assertkeyword, 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
AssertionErrorand 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
assertkeyword, like so:assert that(value, name).- Parameters:
value- the valuename- the name of the value- Returns:
- a validator for the value
- Throws:
NullPointerException- ifnameis nullIllegalArgumentException- ifnamecontains 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
AssertionErrorand 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
assertkeyword, 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
AssertionErrorand 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
assertkeyword, like so:assert that(value, name).- Parameters:
value- the valuename- the name of the value- Returns:
- a validator for the value
- Throws:
NullPointerException- ifnameis nullIllegalArgumentException- ifnamecontains 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
AssertionErrorand 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
assertkeyword, 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
AssertionErrorand 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
assertkeyword, like so:assert that(value, name).- Parameters:
value- the valuename- the name of the value- Returns:
- a validator for the value
- Throws:
NullPointerException- ifnameis nullIllegalArgumentException- ifnamecontains 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
AssertionErrorand 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
assertkeyword, 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
AssertionErrorand 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
assertkeyword, like so:assert that(value, name).- Parameters:
value- the valuename- the name of the value- Returns:
- a validator for the value
- Throws:
NullPointerException- ifnameis nullIllegalArgumentException- ifnamecontains 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
AssertionErrorand 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
assertkeyword, 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
AssertionErrorand 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
assertkeyword, like so:assert that(value, name).- Parameters:
value- the valuename- the name of the value- Returns:
- a validator for the value
- Throws:
NullPointerException- ifnameis nullIllegalArgumentException- ifnamecontains 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
AssertionErrorand 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
assertkeyword, 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
AssertionErrorand 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
assertkeyword, like so:assert that(value, name).- Parameters:
value- the valuename- the name of the value- Returns:
- a validator for the value
- Throws:
NullPointerException- ifnameis nullIllegalArgumentException- ifnamecontains 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
AssertionErrorand 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
assertkeyword, 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
AssertionErrorand 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
assertkeyword, like so:assert that(value, name).- Parameters:
value- the valuename- the name of the value- Returns:
- a validator for the value
- Throws:
NullPointerException- ifnameis nullIllegalArgumentException- ifnamecontains 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
AssertionErrorand 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
assertkeyword, 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
AssertionErrorand 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
assertkeyword, like so:assert that(value, name).- Parameters:
value- the valuename- the name of the value- Returns:
- a validator for the value
- Throws:
NullPointerException- ifnameis nullIllegalArgumentException- ifnamecontains 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
AssertionErrorand 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
assertkeyword, 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
AssertionErrorand 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
assertkeyword, like so:assert that(value, name).- Parameters:
value- the valuename- the name of the value- Returns:
- a validator for the value
- Throws:
NullPointerException- ifnameis nullIllegalArgumentException- ifnamecontains 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
AssertionErrorand 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
assertkeyword, 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
AssertionErrorand 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
assertkeyword, like so:assert that(value, name).- Parameters:
value- the valuename- the name of the value- Returns:
- a validator for the value
- Throws:
NullPointerException- ifnameis nullIllegalArgumentException- ifnamecontains 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
AssertionErrorand 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
assertkeyword, 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
AssertionErrorand 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
assertkeyword, like so:assert that(value, name).- Parameters:
value- the valuename- the name of the value- Returns:
- a validator for the value
- Throws:
NullPointerException- ifnameis nullIllegalArgumentException- ifnamecontains 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
AssertionErrorand 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
assertkeyword, 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
AssertionErrorand 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
assertkeyword, like so:assert that(value, name).- Parameters:
value- the valuename- the name of the value- Returns:
- a validator for the value
- Throws:
NullPointerException- ifnameis nullIllegalArgumentException- ifnamecontains 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
AssertionErrorand 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
assertkeyword, like so:assert that(value, name).- Parameters:
value- the value- Returns:
- a validator for the value
-
that
Validates the state of aComparableobject.- 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- ifnameis nullIllegalArgumentException- ifnamecontains whitespace or is empty
-
that
Validates the state of aComparableobject.- 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
AssertionErrorand 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
assertkeyword, 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- ifnameis nullIllegalArgumentException- ifnamecontains 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
AssertionErrorand 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
assertkeyword, 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
AssertionErrorand 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
assertkeyword, 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- ifnameis nullIllegalArgumentException- ifnamecontains 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
AssertionErrorand 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
assertkeyword, 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
AssertionErrorand 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
assertkeyword, 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- ifnameis nullIllegalArgumentException- ifnamecontains 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
AssertionErrorand 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
assertkeyword, 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 primitivebytearray.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
assertkeyword, like so:assert that(value, name).- Parameters:
value- the valuename- the name of the value- Returns:
- a validator for the value
- Throws:
NullPointerException- ifnameis nullIllegalArgumentException- ifnamecontains whitespace or is empty
-
that
Validates the state of a primitivebytearray.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
assertkeyword, like so:assert that(value, name).- Parameters:
value- the value- Returns:
- a validator for the value
-
that
Validates the state of a primitiveshortarray.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
assertkeyword, like so:assert that(value, name).- Parameters:
value- the valuename- the name of the value- Returns:
- a validator for the value
- Throws:
NullPointerException- ifnameis nullIllegalArgumentException- ifnamecontains whitespace or is empty
-
that
Validates the state of a primitiveshortarray.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
assertkeyword, like so:assert that(value, name).- Parameters:
value- the value- Returns:
- a validator for the value
-
that
Validates the state of a primitiveintarray.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
assertkeyword, like so:assert that(value, name).- Parameters:
value- the valuename- the name of the value- Returns:
- a validator for the value
- Throws:
NullPointerException- ifnameis nullIllegalArgumentException- ifnamecontains whitespace or is empty
-
that
Validates the state of a primitiveintarray.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
assertkeyword, like so:assert that(value, name).- Parameters:
value- the value- Returns:
- a validator for the value
-
that
Validates the state of a primitivelongarray.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
assertkeyword, like so:assert that(value, name).- Parameters:
value- the valuename- the name of the value- Returns:
- a validator for the value
- Throws:
NullPointerException- ifnameis nullIllegalArgumentException- ifnamecontains whitespace or is empty
-
that
Validates the state of a primitivelongarray.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
assertkeyword, like so:assert that(value, name).- Parameters:
value- the value- Returns:
- a validator for the value
-
that
Validates the state of a primitivefloatarray.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
assertkeyword, like so:assert that(value, name).- Parameters:
value- the valuename- the name of the value- Returns:
- a validator for the value
- Throws:
NullPointerException- ifnameis nullIllegalArgumentException- ifnamecontains whitespace or is empty
-
that
Validates the state of a primitivefloatarray.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
assertkeyword, like so:assert that(value, name).- Parameters:
value- the value- Returns:
- a validator for the value
-
that
Validates the state of a primitivedoublearray.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
assertkeyword, like so:assert that(value, name).- Parameters:
value- the valuename- the name of the value- Returns:
- a validator for the value
- Throws:
NullPointerException- ifnameis nullIllegalArgumentException- ifnamecontains whitespace or is empty
-
that
Validates the state of a primitivedoublearray.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
assertkeyword, like so:assert that(value, name).- Parameters:
value- the value- Returns:
- a validator for the value
-
that
Validates the state of a primitivebooleanarray.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
assertkeyword, like so:assert that(value, name).- Parameters:
value- the valuename- the name of the value- Returns:
- a validator for the value
- Throws:
NullPointerException- ifnameis nullIllegalArgumentException- ifnamecontains whitespace or is empty
-
that
Validates the state of a primitivebooleanarray.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
assertkeyword, like so:assert that(value, name).- Parameters:
value- the value- Returns:
- a validator for the value
- Throws:
NullPointerException- ifnameis nullIllegalArgumentException- ifnamecontains whitespace or is empty
-
that
Validates the state of a primitivechararray.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
assertkeyword, like so:assert that(value, name).- Parameters:
value- the valuename- the name of the value- Returns:
- a validator for the value
- Throws:
NullPointerException- ifnameis nullIllegalArgumentException- ifnamecontains whitespace or is empty
-
that
Validates the state of a primitivechararray.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
assertkeyword, like so:assert that(value, name).- Parameters:
value- the value- Returns:
- a validator for the value
-
that
Validates the state of anObjectarray.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
assertkeyword, 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- ifnameis nullIllegalArgumentException- ifnamecontains whitespace or is empty
-
that
Validates the state of anObjectarray.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
assertkeyword, 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
assertkeyword, 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- ifnameis nullIllegalArgumentException- ifnamecontains 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
assertkeyword, 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
assertkeyword, like so:assert that(value, name).- Parameters:
value- the valuename- the name of the value- Returns:
- a validator for the value
- Throws:
NullPointerException- ifnameis nullIllegalArgumentException- ifnamecontains 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
assertkeyword, 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
assertkeyword, like so:assert that(value, name).- Parameters:
value- the valuename- the name of the value- Returns:
- a validator for the value
- Throws:
NullPointerException- ifnameis nullIllegalArgumentException- ifnamecontains 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
assertkeyword, 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
assertkeyword, like so:assert that(value, name).- Parameters:
value- the valuename- the name of the value- Returns:
- a validator for the value
- Throws:
NullPointerException- ifnameis nullIllegalArgumentException- ifnamecontains 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
assertkeyword, 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
assertkeyword, like so:assert that(value, name).- Type Parameters:
T- the type of the class modelled by theClassobject- Parameters:
value- the valuename- the name of the value- Returns:
- a validator for the value
- Throws:
NullPointerException- ifnameis nullIllegalArgumentException- ifnamecontains 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
assertkeyword, like so:assert that(value, name).- Type Parameters:
T- the type of the class modelled by theClassobject- 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
assertkeyword, 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- ifnameis nullIllegalArgumentException- ifnamecontains 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
assertkeyword, 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
assertkeyword, like so:assert that(value, name).- Parameters:
value- the valuename- the name of the value- Returns:
- a validator for the value
- Throws:
NullPointerException- ifnameis nullIllegalArgumentException- ifnamecontains 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
assertkeyword, 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- ifnameis nullIllegalArgumentException- ifnamecontains whitespace or is empty
-
checkIf
Validates the state of abyteThe 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 aByteThe 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- ifnameis nullIllegalArgumentException- ifnamecontains whitespace or is empty
-
checkIf
Validates the state of aByteThe 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 ashortThe 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- ifnameis nullIllegalArgumentException- ifnamecontains whitespace, or is empty
-
checkIf
Validates the state of ashortThe 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 aShortThe 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- ifnameis nullIllegalArgumentException- ifnamecontains whitespace or is empty
-
checkIf
Validates the state of aShortThe 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 anintThe 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- ifnameis nullIllegalArgumentException- ifnamecontains whitespace or is empty
-
checkIf
Validates the state of anintThe 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 anIntegerThe 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- ifnameis nullIllegalArgumentException- ifnamecontains whitespace or is empty
-
checkIf
Validates the state of anIntegerThe 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 alongThe 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- ifnameis nullIllegalArgumentException- ifnamecontains whitespace or is empty
-
checkIf
Validates the state of alongThe 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 aLongThe 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- ifnameis nullIllegalArgumentException- ifnamecontains whitespace or is empty
-
checkIf
Validates the state of aLongThe 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 afloatThe 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- ifnameis nullIllegalArgumentException- ifnamecontains whitespace or is empty
-
checkIf
Validates the state of afloatThe 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 aFloatThe 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- ifnameis nullIllegalArgumentException- ifnamecontains whitespace or is empty
-
checkIf
Validates the state of aFloatThe 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 adoubleThe 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- ifnameis nullIllegalArgumentException- ifnamecontains whitespace or is empty
-
checkIf
Validates the state of adoubleThe 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 aDoubleThe 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- ifnameis nullIllegalArgumentException- ifnamecontains whitespace or is empty
-
checkIf
Validates the state of aDoubleThe 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 abooleanThe 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- ifnameis nullIllegalArgumentException- ifnamecontains whitespace or is empty
-
checkIf
Validates the state of abooleanThe 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 aBooleanThe 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- ifnameis nullIllegalArgumentException- ifnamecontains whitespace or is empty
-
checkIf
Validates the state of aBooleanThe 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 acharThe 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- ifnameis nullIllegalArgumentException- ifnamecontains whitespace or is empty
-
checkIf
Validates the state of acharThe 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 aCharacterThe 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- ifnameis nullIllegalArgumentException- ifnamecontains whitespace or is empty
-
checkIf
Validates the state of aCharacterThe 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 aBigIntegerThe 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- ifnameis nullIllegalArgumentException- ifnamecontains whitespace or is empty
-
checkIf
Validates the state of aBigIntegerThe 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 aBigDecimalThe 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- ifnameis nullIllegalArgumentException- ifnamecontains whitespace or is empty
-
checkIf
Validates the state of aBigDecimalThe 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 aComparableobject.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- ifnameis nullIllegalArgumentException- ifnamecontains whitespace or is empty
-
checkIf
Validates the state of aComparableobject.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 anObjectThe 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- ifnameis nullIllegalArgumentException- ifnamecontains whitespace or is empty
-
checkIf
Validates the state of anObjectThe 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 aCollectionThe 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- ifnameis nullIllegalArgumentException- ifnamecontains whitespace or is empty
-
checkIf
Validates the state of aCollectionThe 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 aListThe 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- ifnameis nullIllegalArgumentException- ifnamecontains whitespace or is empty
-
checkIf
Validates the state of aListThe 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 primitivebytearray.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- ifnameis nullIllegalArgumentException- ifnamecontains whitespace or is empty
-
checkIf
Validates the state of a primitivebytearray.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 primitiveshortarray.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- ifnameis nullIllegalArgumentException- ifnamecontains whitespace or is empty
-
checkIf
Validates the state of a primitiveshortarray.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 primitiveintarray.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- ifnameis nullIllegalArgumentException- ifnamecontains whitespace or is empty
-
checkIf
Validates the state of a primitiveintarray.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 primitivelongarray.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- ifnameis nullIllegalArgumentException- ifnamecontains whitespace or is empty
-
checkIf
Validates the state of a primitivelongarray.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 primitivefloatarray.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- ifnameis nullIllegalArgumentException- ifnamecontains whitespace or is empty
-
checkIf
Validates the state of a primitivefloatarray.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 primitivedoublearray.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- ifnameis nullIllegalArgumentException- ifnamecontains whitespace or is empty
-
checkIf
Validates the state of a primitivedoublearray.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 primitivebooleanarray.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- ifnameis nullIllegalArgumentException- ifnamecontains whitespace or is empty
-
checkIf
Validates the state of a primitivebooleanarray.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 primitivechararray.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- ifnameis nullIllegalArgumentException- ifnamecontains whitespace or is empty
-
checkIf
Validates the state of a primitivechararray.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 anObjectarray.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- ifnameis nullIllegalArgumentException- ifnamecontains whitespace or is empty
-
checkIf
Validates the state of anObjectarray.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- ifnameis nullIllegalArgumentException- ifnamecontains 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- ifnameis nullIllegalArgumentException- ifnamecontains 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- ifnameis nullIllegalArgumentException- ifnamecontains 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- ifnameis nullIllegalArgumentException- ifnamecontains 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 theClassobject- Parameters:
value- the valuename- the name of the value- Returns:
- a validator for the value
- Throws:
NullPointerException- ifnameis nullIllegalArgumentException- ifnamecontains 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 theClassobject- 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 theClassobject- Parameters:
value- the valuename- the name of the value- Returns:
- a validator for the value
- Throws:
NullPointerException- ifnameis nullIllegalArgumentException- ifnamecontains 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 theClassobject- 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- ifnameis nullIllegalArgumentException- ifnamecontains 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.smithNote that values are wrapped in an
Optionalbecause modern maps do not supportnullvalues.- 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- ifnameis 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- ifnameis 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
-