All Known Subinterfaces:
JavaValidators

public interface JavaAssertThat
Creates validators for the Java API that capture exceptions on validation failure rather than throwing them immediately. The exceptions are converted into an AssertionError.
  • Method Details

    • that

      PrimitiveByteValidator that(byte value, String name)
      Validates the state of a byte.

      The returned validator captures exceptions on validation failure rather than throwing them immediately. The exceptions are converted into an AssertionError and can be retrieved or thrown once the validation completes. Exceptions unrelated to validation failures are thrown immediately.

      This method is intended to be used with the assert keyword, like so: assert that(value, name).

      Parameters:
      value - the value
      name - the name of the value
      Returns:
      a validator for the value
      Throws:
      NullPointerException - if name is null
      IllegalArgumentException - if name contains whitespace, or is empty
    • that

      PrimitiveByteValidator that(byte value)
      Validates the state of a byte.

      The returned validator captures exceptions on validation failure rather than throwing them immediately. The exceptions are converted into an AssertionError and can be retrieved or thrown once the validation completes. Exceptions unrelated to validation failures are thrown immediately.

      This method is intended to be used with the assert keyword, like so: assert that(value, name).

      Parameters:
      value - the value
      Returns:
      a validator for the value
    • that

      ByteValidator that(Byte value, String name)
      Validates the state of a Byte.

      The returned validator captures exceptions on validation failure rather than throwing them immediately. The exceptions are converted into an AssertionError and can be retrieved or thrown once the validation completes. Exceptions unrelated to validation failures are thrown immediately.

      This method is intended to be used with the assert keyword, like so: assert that(value, name).

      Parameters:
      value - the value
      name - the name of the value
      Returns:
      a validator for the value
      Throws:
      NullPointerException - if name is null
      IllegalArgumentException - if name contains whitespace, or is empty
    • that

      ByteValidator that(Byte value)
      Validates the state of a Byte.

      The returned validator captures exceptions on validation failure rather than throwing them immediately. The exceptions are converted into an AssertionError and can be retrieved or thrown once the validation completes. Exceptions unrelated to validation failures are thrown immediately.

      This method is intended to be used with the assert keyword, like so: assert that(value, name).

      Parameters:
      value - the value
      Returns:
      a validator for the value
    • that

      PrimitiveShortValidator that(short value, String name)
      Validates the state of a short.

      The returned validator captures exceptions on validation failure rather than throwing them immediately. The exceptions are converted into an AssertionError and can be retrieved or thrown once the validation completes. Exceptions unrelated to validation failures are thrown immediately.

      This method is intended to be used with the assert keyword, like so: assert that(value, name).

      Parameters:
      value - the value
      name - the name of the value
      Returns:
      a validator for the value
      Throws:
      NullPointerException - if name is null
      IllegalArgumentException - if name contains whitespace, or is empty
    • that

      PrimitiveShortValidator that(short value)
      Validates the state of a short.

      The returned validator captures exceptions on validation failure rather than throwing them immediately. The exceptions are converted into an AssertionError and can be retrieved or thrown once the validation completes. Exceptions unrelated to validation failures are thrown immediately.

      This method is intended to be used with the assert keyword, like so: assert that(value, name).

      Parameters:
      value - the value
      Returns:
      a validator for the value
    • that

      ShortValidator that(Short value, String name)
      Validates the state of a Short.

      The returned validator captures exceptions on validation failure rather than throwing them immediately. The exceptions are converted into an AssertionError and can be retrieved or thrown once the validation completes. Exceptions unrelated to validation failures are thrown immediately.

      This method is intended to be used with the assert keyword, like so: assert that(value, name).

      Parameters:
      value - the value
      name - the name of the value
      Returns:
      a validator for the value
      Throws:
      NullPointerException - if name is null
      IllegalArgumentException - if name contains whitespace, or is empty
    • that

      ShortValidator that(Short value)
      Validates the state of a Short.

      The returned validator captures exceptions on validation failure rather than throwing them immediately. The exceptions are converted into an AssertionError and can be retrieved or thrown once the validation completes. Exceptions unrelated to validation failures are thrown immediately.

      This method is intended to be used with the assert keyword, like so: assert that(value, name).

      Parameters:
      value - the value
      Returns:
      a validator for the value
    • that

      PrimitiveIntegerValidator that(int value, String name)
      Validates the state of an int.

      The returned validator captures exceptions on validation failure rather than throwing them immediately. The exceptions are converted into an AssertionError and can be retrieved or thrown once the validation completes. Exceptions unrelated to validation failures are thrown immediately.

      This method is intended to be used with the assert keyword, like so: assert that(value, name).

      Parameters:
      value - the value
      name - the name of the value
      Returns:
      a validator for the value
      Throws:
      NullPointerException - if name is null
      IllegalArgumentException - if name contains whitespace or is empty
    • that

      PrimitiveIntegerValidator that(int value)
      Validates the state of an int.

      The returned validator captures exceptions on validation failure rather than throwing them immediately. The exceptions are converted into an AssertionError and can be retrieved or thrown once the validation completes. Exceptions unrelated to validation failures are thrown immediately.

      This method is intended to be used with the assert keyword, like so: assert that(value, name).

      Parameters:
      value - the value
      Returns:
      a validator for the value
    • that

      IntegerValidator that(Integer value, String name)
      Validates the state of an Integer.

      The returned validator captures exceptions on validation failure rather than throwing them immediately. The exceptions are converted into an AssertionError and can be retrieved or thrown once the validation completes. Exceptions unrelated to validation failures are thrown immediately.

      This method is intended to be used with the assert keyword, like so: assert that(value, name).

      Parameters:
      value - the value
      name - the name of the value
      Returns:
      a validator for the value
      Throws:
      NullPointerException - if name is null
      IllegalArgumentException - if name contains whitespace or is empty
    • that

      Validates the state of an Integer.

      The returned validator captures exceptions on validation failure rather than throwing them immediately. The exceptions are converted into an AssertionError and can be retrieved or thrown once the validation completes. Exceptions unrelated to validation failures are thrown immediately.

      This method is intended to be used with the assert keyword, like so: assert that(value, name).

      Parameters:
      value - the value
      Returns:
      a validator for the value
    • that

      PrimitiveLongValidator that(long value, String name)
      Validates the state of a long.

      The returned validator captures exceptions on validation failure rather than throwing them immediately. The exceptions are converted into an AssertionError and can be retrieved or thrown once the validation completes. Exceptions unrelated to validation failures are thrown immediately.

      This method is intended to be used with the assert keyword, like so: assert that(value, name).

      Parameters:
      value - the value
      name - the name of the value
      Returns:
      a validator for the value
      Throws:
      NullPointerException - if name is null
      IllegalArgumentException - if name contains whitespace or is empty
    • that

      PrimitiveLongValidator that(long value)
      Validates the state of a long.

      The returned validator captures exceptions on validation failure rather than throwing them immediately. The exceptions are converted into an AssertionError and can be retrieved or thrown once the validation completes. Exceptions unrelated to validation failures are thrown immediately.

      This method is intended to be used with the assert keyword, like so: assert that(value, name).

      Parameters:
      value - the value
      Returns:
      a validator for the value
    • that

      LongValidator that(Long value, String name)
      Validates the state of a Long.

      The returned validator captures exceptions on validation failure rather than throwing them immediately. The exceptions are converted into an AssertionError and can be retrieved or thrown once the validation completes. Exceptions unrelated to validation failures are thrown immediately.

      This method is intended to be used with the assert keyword, like so: assert that(value, name).

      Parameters:
      value - the value
      name - the name of the value
      Returns:
      a validator for the value
      Throws:
      NullPointerException - if name is null
      IllegalArgumentException - if name contains whitespace or is empty
    • that

      LongValidator that(Long value)
      Validates the state of a Long.

      The returned validator captures exceptions on validation failure rather than throwing them immediately. The exceptions are converted into an AssertionError and can be retrieved or thrown once the validation completes. Exceptions unrelated to validation failures are thrown immediately.

      This method is intended to be used with the assert keyword, like so: assert that(value, name).

      Parameters:
      value - the value
      Returns:
      a validator for the value
    • that

      PrimitiveFloatValidator that(float value, String name)
      Validates the state of a float.

      The returned validator captures exceptions on validation failure rather than throwing them immediately. The exceptions are converted into an AssertionError and can be retrieved or thrown once the validation completes. Exceptions unrelated to validation failures are thrown immediately.

      This method is intended to be used with the assert keyword, like so: assert that(value, name).

      Parameters:
      value - the value
      name - the name of the value
      Returns:
      a validator for the value
      Throws:
      NullPointerException - if name is null
      IllegalArgumentException - if name contains whitespace or is empty
    • that

      PrimitiveFloatValidator that(float value)
      Validates the state of a float.

      The returned validator captures exceptions on validation failure rather than throwing them immediately. The exceptions are converted into an AssertionError and can be retrieved or thrown once the validation completes. Exceptions unrelated to validation failures are thrown immediately.

      This method is intended to be used with the assert keyword, like so: assert that(value, name).

      Parameters:
      value - the value
      Returns:
      a validator for the value
    • that

      FloatValidator that(Float value, String name)
      Validates the state of a Float.

      The returned validator captures exceptions on validation failure rather than throwing them immediately. The exceptions are converted into an AssertionError and can be retrieved or thrown once the validation completes. Exceptions unrelated to validation failures are thrown immediately.

      This method is intended to be used with the assert keyword, like so: assert that(value, name).

      Parameters:
      value - the value
      name - the name of the value
      Returns:
      a validator for the value
      Throws:
      NullPointerException - if name is null
      IllegalArgumentException - if name contains whitespace or is empty
    • that

      FloatValidator that(Float value)
      Validates the state of a Float.

      The returned validator captures exceptions on validation failure rather than throwing them immediately. The exceptions are converted into an AssertionError and can be retrieved or thrown once the validation completes. Exceptions unrelated to validation failures are thrown immediately.

      This method is intended to be used with the assert keyword, like so: assert that(value, name).

      Parameters:
      value - the value
      Returns:
      a validator for the value
    • that

      PrimitiveDoubleValidator that(double value, String name)
      Validates the state of a double.

      The returned validator captures exceptions on validation failure rather than throwing them immediately. The exceptions are converted into an AssertionError and can be retrieved or thrown once the validation completes. Exceptions unrelated to validation failures are thrown immediately.

      This method is intended to be used with the assert keyword, like so: assert that(value, name).

      Parameters:
      value - the value
      name - the name of the value
      Returns:
      a validator for the value
      Throws:
      NullPointerException - if name is null
      IllegalArgumentException - if name contains whitespace or is empty
    • that

      PrimitiveDoubleValidator that(double value)
      Validates the state of a double.

      The returned validator captures exceptions on validation failure rather than throwing them immediately. The exceptions are converted into an AssertionError and can be retrieved or thrown once the validation completes. Exceptions unrelated to validation failures are thrown immediately.

      This method is intended to be used with the assert keyword, like so: assert that(value, name).

      Parameters:
      value - the value
      Returns:
      a validator for the value
    • that

      DoubleValidator that(Double value, String name)
      Validates the state of a Double.

      The returned validator captures exceptions on validation failure rather than throwing them immediately. The exceptions are converted into an AssertionError and can be retrieved or thrown once the validation completes. Exceptions unrelated to validation failures are thrown immediately.

      This method is intended to be used with the assert keyword, like so: assert that(value, name).

      Parameters:
      value - the value
      name - the name of the value
      Returns:
      a validator for the value
      Throws:
      NullPointerException - if name is null
      IllegalArgumentException - if name contains whitespace or is empty
    • that

      DoubleValidator that(Double value)
      Validates the state of a Double.

      The returned validator captures exceptions on validation failure rather than throwing them immediately. The exceptions are converted into an AssertionError and can be retrieved or thrown once the validation completes. Exceptions unrelated to validation failures are thrown immediately.

      This method is intended to be used with the assert keyword, like so: assert that(value, name).

      Parameters:
      value - the value
      Returns:
      a validator for the value
    • that

      PrimitiveBooleanValidator that(boolean value, String name)
      Validates the state of a boolean.

      The returned validator captures exceptions on validation failure rather than throwing them immediately. The exceptions are converted into an AssertionError and can be retrieved or thrown once the validation completes. Exceptions unrelated to validation failures are thrown immediately.

      This method is intended to be used with the assert keyword, like so: assert that(value, name).

      Parameters:
      value - the value
      name - the name of the value
      Returns:
      a validator for the value
      Throws:
      NullPointerException - if name is null
      IllegalArgumentException - if name contains whitespace or is empty
    • that

      PrimitiveBooleanValidator that(boolean value)
      Validates the state of a boolean.

      The returned validator captures exceptions on validation failure rather than throwing them immediately. The exceptions are converted into an AssertionError and can be retrieved or thrown once the validation completes. Exceptions unrelated to validation failures are thrown immediately.

      This method is intended to be used with the assert keyword, like so: assert that(value, name).

      Parameters:
      value - the value
      Returns:
      a validator for the value
    • that

      BooleanValidator that(Boolean value, String name)
      Validates the state of a Boolean.

      The returned validator captures exceptions on validation failure rather than throwing them immediately. The exceptions are converted into an AssertionError and can be retrieved or thrown once the validation completes. Exceptions unrelated to validation failures are thrown immediately.

      This method is intended to be used with the assert keyword, like so: assert that(value, name).

      Parameters:
      value - the value
      name - the name of the value
      Returns:
      a validator for the value
      Throws:
      NullPointerException - if name is null
      IllegalArgumentException - if name contains whitespace or is empty
    • that

      Validates the state of a Boolean.

      The returned validator captures exceptions on validation failure rather than throwing them immediately. The exceptions are converted into an AssertionError and can be retrieved or thrown once the validation completes. Exceptions unrelated to validation failures are thrown immediately.

      This method is intended to be used with the assert keyword, like so: assert that(value, name).

      Parameters:
      value - the value
      Returns:
      a validator for the value
    • that

      PrimitiveCharacterValidator that(char value, String name)
      Validates the state of a char.

      The returned validator captures exceptions on validation failure rather than throwing them immediately. The exceptions are converted into an AssertionError and can be retrieved or thrown once the validation completes. Exceptions unrelated to validation failures are thrown immediately.

      This method is intended to be used with the assert keyword, like so: assert that(value, name).

      Parameters:
      value - the value
      name - the name of the value
      Returns:
      a validator for the value
      Throws:
      NullPointerException - if name is null
      IllegalArgumentException - if name contains whitespace or is empty
    • that

      PrimitiveCharacterValidator that(char value)
      Validates the state of a char.

      The returned validator captures exceptions on validation failure rather than throwing them immediately. The exceptions are converted into an AssertionError and can be retrieved or thrown once the validation completes. Exceptions unrelated to validation failures are thrown immediately.

      This method is intended to be used with the assert keyword, like so: assert that(value, name).

      Parameters:
      value - the value
      Returns:
      a validator for the value
    • that

      CharacterValidator that(Character value, String name)
      Validates the state of a Character.

      The returned validator captures exceptions on validation failure rather than throwing them immediately. The exceptions are converted into an AssertionError and can be retrieved or thrown once the validation completes. Exceptions unrelated to validation failures are thrown immediately.

      This method is intended to be used with the assert keyword, like so: assert that(value, name).

      Parameters:
      value - the value
      name - the name of the value
      Returns:
      a validator for the value
      Throws:
      NullPointerException - if name is null
      IllegalArgumentException - if name contains whitespace or is empty
    • that

      Validates the state of a Character.

      The returned validator captures exceptions on validation failure rather than throwing them immediately. The exceptions are converted into an AssertionError and can be retrieved or thrown once the validation completes. Exceptions unrelated to validation failures are thrown immediately.

      This method is intended to be used with the assert keyword, like so: assert that(value, name).

      Parameters:
      value - the value
      Returns:
      a validator for the value
    • that

      Validates the state of a BigInteger.

      The returned validator captures exceptions on validation failure rather than throwing them immediately. The exceptions are converted into an AssertionError and can be retrieved or thrown once the validation completes. Exceptions unrelated to validation failures are thrown immediately.

      This method is intended to be used with the assert keyword, like so: assert that(value, name).

      Parameters:
      value - the value
      name - the name of the value
      Returns:
      a validator for the value
      Throws:
      NullPointerException - if name is null
      IllegalArgumentException - if name contains whitespace or is empty
    • that

      Validates the state of a BigInteger.

      The returned validator captures exceptions on validation failure rather than throwing them immediately. The exceptions are converted into an AssertionError and can be retrieved or thrown once the validation completes. Exceptions unrelated to validation failures are thrown immediately.

      This method is intended to be used with the assert keyword, like so: assert that(value, name).

      Parameters:
      value - the value
      Returns:
      a validator for the value
    • that

      Validates the state of a BigDecimal.

      The returned validator captures exceptions on validation failure rather than throwing them immediately. The exceptions are converted into an AssertionError and can be retrieved or thrown once the validation completes. Exceptions unrelated to validation failures are thrown immediately.

      This method is intended to be used with the assert keyword, like so: assert that(value, name).

      Parameters:
      value - the value
      name - the name of the value
      Returns:
      a validator for the value
      Throws:
      NullPointerException - if name is null
      IllegalArgumentException - if name contains whitespace or is empty
    • that

      Validates the state of a BigDecimal.

      The returned validator captures exceptions on validation failure rather than throwing them immediately. The exceptions are converted into an AssertionError and can be retrieved or thrown once the validation completes. Exceptions unrelated to validation failures are thrown immediately.

      This method is intended to be used with the assert keyword, like so: assert that(value, name).

      Parameters:
      value - the value
      Returns:
      a validator for the value
    • that

      <T extends Comparable<T>> ComparableValidator<T> that(T value, String name)
      Validates the state of a Comparable object.
      Type Parameters:
      T - the type of the value
      Parameters:
      value - the value
      name - the name of the value
      Returns:
      a validator for the value
      Throws:
      NullPointerException - if name is null
      IllegalArgumentException - if name contains whitespace or is empty
    • that

      <T extends Comparable<T>> ComparableValidator<T> that(T value)
      Validates the state of a Comparable object.
      Type Parameters:
      T - the type of the value
      Parameters:
      value - the value
      Returns:
      a validator for the value
    • that

      <T> ObjectValidator<T> that(T value, String name)
      Validates the state of an Object.

      The returned validator captures exceptions on validation failure rather than throwing them immediately. The exceptions are converted into an AssertionError and can be retrieved or thrown once the validation completes. Exceptions unrelated to validation failures are thrown immediately.

      This method is intended to be used with the assert keyword, like so: assert that(value, name).

      Type Parameters:
      T - the type of the value
      Parameters:
      value - the value
      name - the name of the value
      Returns:
      a validator for the value
      Throws:
      NullPointerException - if name is null
      IllegalArgumentException - if name contains whitespace or is empty
    • that

      <T> ObjectValidator<T> that(T value)
      Validates the state of an Object.

      The returned validator captures exceptions on validation failure rather than throwing them immediately. The exceptions are converted into an AssertionError and can be retrieved or thrown once the validation completes. Exceptions unrelated to validation failures are thrown immediately.

      This method is intended to be used with the assert keyword, like so: assert that(value, name).

      Type Parameters:
      T - the type of the value
      Parameters:
      value - the value
      Returns:
      a validator for the value
    • that

      <T extends Collection<E>, E> CollectionValidator<T,E> that(T value, String name)
      Validates the state of a Collection.

      The returned validator captures exceptions on validation failure rather than throwing them immediately. The exceptions are converted into an AssertionError and can be retrieved or thrown once the validation completes. Exceptions unrelated to validation failures are thrown immediately.

      This method is intended to be used with the assert keyword, like so: assert that(value, name).

      Type Parameters:
      T - the type of the value
      E - the type of elements in the collection
      Parameters:
      value - the value
      name - the name of the value
      Returns:
      a validator for the value
      Throws:
      NullPointerException - if name is null
      IllegalArgumentException - if name contains whitespace or is empty
    • that

      <T extends Collection<E>, E> CollectionValidator<T,E> that(T value)
      Validates the state of a Collection.

      The returned validator captures exceptions on validation failure rather than throwing them immediately. The exceptions are converted into an AssertionError and can be retrieved or thrown once the validation completes. Exceptions unrelated to validation failures are thrown immediately.

      This method is intended to be used with the assert keyword, like so: assert that(value, name).

      Type Parameters:
      T - the type of the value
      E - the type of elements in the collection
      Parameters:
      value - the value
      Returns:
      a validator for the value
    • that

      <T extends List<E>, E> ListValidator<T,E> that(T value, String name)
      Validates the state of a List.

      The returned validator captures exceptions on validation failure rather than throwing them immediately. The exceptions are converted into an AssertionError and can be retrieved or thrown once the validation completes. Exceptions unrelated to validation failures are thrown immediately.

      This method is intended to be used with the assert keyword, like so: assert that(value, name).

      Type Parameters:
      T - the type of the value
      E - the type of elements in the list
      Parameters:
      value - the value
      name - the name of the value
      Returns:
      a validator for the value
      Throws:
      NullPointerException - if name is null
      IllegalArgumentException - if name contains whitespace or is empty
    • that

      <T extends List<E>, E> ListValidator<T,E> that(T value)
      Validates the state of a List.

      The returned validator captures exceptions on validation failure rather than throwing them immediately. The exceptions are converted into an AssertionError and can be retrieved or thrown once the validation completes. Exceptions unrelated to validation failures are thrown immediately.

      This method is intended to be used with the assert keyword, like so: assert that(value, name).

      Type Parameters:
      T - the type of the value
      E - the type of elements in the list
      Parameters:
      value - the value
      Returns:
      a validator for the value
    • that

      PrimitiveByteArrayValidator that(byte[] value, String name)
      Validates the state of a primitive byte array.

      The returned validator captures exceptions on validation failure rather than throwing them immediately. The exceptions are converted into an AssertionError and can be retrieved or thrown once the validation completes. Exceptions unrelated to validation failures are thrown immediately.

      This method is intended to be used with the assert keyword, like so: assert that(value, name).

      Parameters:
      value - the value
      name - the name of the value
      Returns:
      a validator for the value
      Throws:
      NullPointerException - if name is null
      IllegalArgumentException - if name contains whitespace or is empty
    • that

      PrimitiveByteArrayValidator that(byte[] value)
      Validates the state of a primitive byte array.

      The returned validator captures exceptions on validation failure rather than throwing them immediately. The exceptions are converted into an AssertionError and can be retrieved or thrown once the validation completes. Exceptions unrelated to validation failures are thrown immediately.

      This method is intended to be used with the assert keyword, like so: assert that(value, name).

      Parameters:
      value - the value
      Returns:
      a validator for the value
    • that

      PrimitiveShortArrayValidator that(short[] value, String name)
      Validates the state of a primitive short array.

      The returned validator captures exceptions on validation failure rather than throwing them immediately. The exceptions are converted into an AssertionError and can be retrieved or thrown once the validation completes. Exceptions unrelated to validation failures are thrown immediately.

      This method is intended to be used with the assert keyword, like so: assert that(value, name).

      Parameters:
      value - the value
      name - the name of the value
      Returns:
      a validator for the value
      Throws:
      NullPointerException - if name is null
      IllegalArgumentException - if name contains whitespace or is empty
    • that

      PrimitiveShortArrayValidator that(short[] value)
      Validates the state of a primitive short array.

      The returned validator captures exceptions on validation failure rather than throwing them immediately. The exceptions are converted into an AssertionError and can be retrieved or thrown once the validation completes. Exceptions unrelated to validation failures are thrown immediately.

      This method is intended to be used with the assert keyword, like so: assert that(value, name).

      Parameters:
      value - the value
      Returns:
      a validator for the value
    • that

      PrimitiveIntegerArrayValidator that(int[] value, String name)
      Validates the state of a primitive int array.

      The returned validator captures exceptions on validation failure rather than throwing them immediately. The exceptions are converted into an AssertionError and can be retrieved or thrown once the validation completes. Exceptions unrelated to validation failures are thrown immediately.

      This method is intended to be used with the assert keyword, like so: assert that(value, name).

      Parameters:
      value - the value
      name - the name of the value
      Returns:
      a validator for the value
      Throws:
      NullPointerException - if name is null
      IllegalArgumentException - if name contains whitespace or is empty
    • that

      PrimitiveIntegerArrayValidator that(int[] value)
      Validates the state of a primitive int array.

      The returned validator captures exceptions on validation failure rather than throwing them immediately. The exceptions are converted into an AssertionError and can be retrieved or thrown once the validation completes. Exceptions unrelated to validation failures are thrown immediately.

      This method is intended to be used with the assert keyword, like so: assert that(value, name).

      Parameters:
      value - the value
      Returns:
      a validator for the value
    • that

      PrimitiveLongArrayValidator that(long[] value, String name)
      Validates the state of a primitive long array.

      The returned validator captures exceptions on validation failure rather than throwing them immediately. The exceptions are converted into an AssertionError and can be retrieved or thrown once the validation completes. Exceptions unrelated to validation failures are thrown immediately.

      This method is intended to be used with the assert keyword, like so: assert that(value, name).

      Parameters:
      value - the value
      name - the name of the value
      Returns:
      a validator for the value
      Throws:
      NullPointerException - if name is null
      IllegalArgumentException - if name contains whitespace or is empty
    • that

      PrimitiveLongArrayValidator that(long[] value)
      Validates the state of a primitive long array.

      The returned validator captures exceptions on validation failure rather than throwing them immediately. The exceptions are converted into an AssertionError and can be retrieved or thrown once the validation completes. Exceptions unrelated to validation failures are thrown immediately.

      This method is intended to be used with the assert keyword, like so: assert that(value, name).

      Parameters:
      value - the value
      Returns:
      a validator for the value
    • that

      PrimitiveFloatArrayValidator that(float[] value, String name)
      Validates the state of a primitive float array.

      The returned validator captures exceptions on validation failure rather than throwing them immediately. The exceptions are converted into an AssertionError and can be retrieved or thrown once the validation completes. Exceptions unrelated to validation failures are thrown immediately.

      This method is intended to be used with the assert keyword, like so: assert that(value, name).

      Parameters:
      value - the value
      name - the name of the value
      Returns:
      a validator for the value
      Throws:
      NullPointerException - if name is null
      IllegalArgumentException - if name contains whitespace or is empty
    • that

      PrimitiveFloatArrayValidator that(float[] value)
      Validates the state of a primitive float array.

      The returned validator captures exceptions on validation failure rather than throwing them immediately. The exceptions are converted into an AssertionError and can be retrieved or thrown once the validation completes. Exceptions unrelated to validation failures are thrown immediately.

      This method is intended to be used with the assert keyword, like so: assert that(value, name).

      Parameters:
      value - the value
      Returns:
      a validator for the value
    • that

      PrimitiveDoubleArrayValidator that(double[] value, String name)
      Validates the state of a primitive double array.

      The returned validator throws an exception immediately if a validation fails. This exception is then converted into an AssertionError. Exceptions unrelated to validation failures are not converted.

      This method is intended to be used with the assert keyword, like so: assert that(value, name).

      Parameters:
      value - the value
      name - the name of the value
      Returns:
      a validator for the value
      Throws:
      NullPointerException - if name is null
      IllegalArgumentException - if name contains whitespace or is empty
    • that

      PrimitiveDoubleArrayValidator that(double[] value)
      Validates the state of a primitive double array.

      The returned validator throws an exception immediately if a validation fails. This exception is then converted into an AssertionError. Exceptions unrelated to validation failures are not converted.

      This method is intended to be used with the assert keyword, like so: assert that(value, name).

      Parameters:
      value - the value
      Returns:
      a validator for the value
    • that

      PrimitiveBooleanArrayValidator that(boolean[] value, String name)
      Validates the state of a primitive boolean array.

      The returned validator throws an exception immediately if a validation fails. This exception is then converted into an AssertionError. Exceptions unrelated to validation failures are not converted.

      This method is intended to be used with the assert keyword, like so: assert that(value, name).

      Parameters:
      value - the value
      name - the name of the value
      Returns:
      a validator for the value
      Throws:
      NullPointerException - if name is null
      IllegalArgumentException - if name contains whitespace or is empty
    • that

      PrimitiveBooleanArrayValidator that(boolean[] value)
      Validates the state of a primitive boolean array.

      The returned validator throws an exception immediately if a validation fails. This exception is then converted into an AssertionError. Exceptions unrelated to validation failures are not converted.

      This method is intended to be used with the assert keyword, like so: assert that(value, name).

      Parameters:
      value - the value
      Returns:
      a validator for the value
      Throws:
      NullPointerException - if name is null
      IllegalArgumentException - if name contains whitespace or is empty
    • that

      PrimitiveCharacterArrayValidator that(char[] value, String name)
      Validates the state of a primitive char array.

      The returned validator throws an exception immediately if a validation fails. This exception is then converted into an AssertionError. Exceptions unrelated to validation failures are not converted.

      This method is intended to be used with the assert keyword, like so: assert that(value, name).

      Parameters:
      value - the value
      name - the name of the value
      Returns:
      a validator for the value
      Throws:
      NullPointerException - if name is null
      IllegalArgumentException - if name contains whitespace or is empty
    • that

      Validates the state of a primitive char array.

      The returned validator throws an exception immediately if a validation fails. This exception is then converted into an AssertionError. Exceptions unrelated to validation failures are not converted.

      This method is intended to be used with the assert keyword, like so: assert that(value, name).

      Parameters:
      value - the value
      Returns:
      a validator for the value
    • that

      <E> ObjectArrayValidator<E[],E> that(E[] value, String name)
      Validates the state of an Object array.

      The returned validator throws an exception immediately if a validation fails. This exception is then converted into an AssertionError. Exceptions unrelated to validation failures are not converted.

      This method is intended to be used with the assert keyword, like so: assert that(value, name).

      Type Parameters:
      E - the type of elements in the array
      Parameters:
      value - the value
      name - the name of the value
      Returns:
      a validator for the value
      Throws:
      NullPointerException - if name is null
      IllegalArgumentException - if name contains whitespace or is empty
    • that

      <E> ObjectArrayValidator<E[],E> that(E[] value)
      Validates the state of an Object array.

      The returned validator throws an exception immediately if a validation fails. This exception is then converted into an AssertionError. Exceptions unrelated to validation failures are not converted.

      This method is intended to be used with the assert keyword, like so: assert that(value, name).

      Type Parameters:
      E - the type of elements in the array
      Parameters:
      value - the value
      Returns:
      a validator for the value
    • that

      <T extends Map<K, V>, K, V> MapValidator<T,K,V> that(T value, String name)
      Validates the state of a Map.

      The returned validator throws an exception immediately if a validation fails. This exception is then converted into an AssertionError. Exceptions unrelated to validation failures are not converted.

      This method is intended to be used with the assert keyword, like so: assert that(value, name).

      Type Parameters:
      T - the type of the map
      K - the type of keys in the map
      V - the type of values in the map
      Parameters:
      value - the value
      name - the name of the value
      Returns:
      a validator for the value
      Throws:
      NullPointerException - if name is null
      IllegalArgumentException - if name contains whitespace or is empty
    • that

      <T extends Map<K, V>, K, V> MapValidator<T,K,V> that(T value)
      Validates the state of a Map.

      The returned validator throws an exception immediately if a validation fails. This exception is then converted into an AssertionError. Exceptions unrelated to validation failures are not converted.

      This method is intended to be used with the assert keyword, like so: assert that(value, name).

      Type Parameters:
      T - the type of the map
      K - the type of keys in the map
      V - the type of values in the map
      Parameters:
      value - the value
      Returns:
      a validator for the value
    • that

      PathValidator that(Path value, String name)
      Validates the state of a Path.

      The returned validator throws an exception immediately if a validation fails. This exception is then converted into an AssertionError. Exceptions unrelated to validation failures are not converted.

      This method is intended to be used with the assert keyword, like so: assert that(value, name).

      Parameters:
      value - the value
      name - the name of the value
      Returns:
      a validator for the value
      Throws:
      NullPointerException - if name is null
      IllegalArgumentException - if name contains whitespace or is empty
    • that

      PathValidator that(Path value)
      Validates the state of a Path.

      The returned validator throws an exception immediately if a validation fails. This exception is then converted into an AssertionError. Exceptions unrelated to validation failures are not converted.

      This method is intended to be used with the assert keyword, like so: assert that(value, name).

      Parameters:
      value - the value
      Returns:
      a validator for the value
    • that

      StringValidator that(String value, String name)
      Validates the state of a String.

      The returned validator throws an exception immediately if a validation fails. This exception is then converted into an AssertionError. Exceptions unrelated to validation failures are not converted.

      This method is intended to be used with the assert keyword, like so: assert that(value, name).

      Parameters:
      value - the value
      name - the name of the value
      Returns:
      a validator for the value
      Throws:
      NullPointerException - if name is null
      IllegalArgumentException - if name contains whitespace or is empty
    • that

      StringValidator that(String value)
      Validates the state of a String.

      The returned validator throws an exception immediately if a validation fails. This exception is then converted into an AssertionError. Exceptions unrelated to validation failures are not converted.

      This method is intended to be used with the assert keyword, like so: assert that(value, name).

      Parameters:
      value - the value
      Returns:
      a validator for the value
    • that

      UriValidator that(URI value, String name)
      Validates the state of a URI.

      The returned validator throws an exception immediately if a validation fails. This exception is then converted into an AssertionError. Exceptions unrelated to validation failures are not converted.

      This method is intended to be used with the assert keyword, like so: assert that(value, name).

      Parameters:
      value - the value
      name - the name of the value
      Returns:
      a validator for the value
      Throws:
      NullPointerException - if name is null
      IllegalArgumentException - if name contains whitespace or is empty
    • that

      UriValidator that(URI value)
      Validates the state of a URI.

      The returned validator throws an exception immediately if a validation fails. This exception is then converted into an AssertionError. Exceptions unrelated to validation failures are not converted.

      This method is intended to be used with the assert keyword, like so: assert that(value, name).

      Parameters:
      value - the value
      Returns:
      a validator for the value
    • that

      <T> GenericTypeValidator<T> that(Class<T> value)
      Validates the state of a Class.

      The returned validator throws an exception immediately if a validation fails. This exception is then converted into an AssertionError. Exceptions unrelated to validation failures are not converted.

      This method is intended to be used with the assert keyword, like so: assert that(value, name).

      Type Parameters:
      T - the type of the class modelled by the Class object. For types that contain type-parameters, use the TypeToken overload.
      Parameters:
      value - the value
      Returns:
      a validator for the value
    • that

      <T> GenericTypeValidator<T> that(GenericType<T> value)
      Validates the state of a Class.

      The returned validator throws an exception immediately if a validation fails. This exception is then converted into an AssertionError. Exceptions unrelated to validation failures are not converted.

      This method is intended to be used with the assert keyword, like so: assert that(value, name).

      Type Parameters:
      T - the type of the class modelled by the Class object. For types without type-parameters, prefer the Class overload.
      Parameters:
      value - the value
      Returns:
      a validator for the value
    • that

      <T> GenericTypeValidator<T> that(Class<T> value, String name)
      Validates the state of a Class.

      The returned validator throws an exception immediately if a validation fails. This exception is then converted into an AssertionError. Exceptions unrelated to validation failures are not converted.

      This method is intended to be used with the assert keyword, like so: assert that(value, name).

      Type Parameters:
      T - the type of the class modelled by the Class object. For types that contain type-parameters, use the TypeToken overload.
      Parameters:
      value - the value
      name - the name of the value
      Returns:
      a validator for the value
      Throws:
      NullPointerException - if name is null
      IllegalArgumentException - if name contains whitespace or is empty
    • that

      <T> GenericTypeValidator<T> that(GenericType<T> value, String name)
      Validates the state of a Class.

      The returned validator throws an exception immediately if a validation fails. This exception is then converted into an AssertionError. Exceptions unrelated to validation failures are not converted.

      This method is intended to be used with the assert keyword, like so: assert that(value, name).

      Type Parameters:
      T - the type of the class modelled by the Class object. For types without type-parameters, prefer the Class overload.
      Parameters:
      value - the value
      name - the name of the value
      Returns:
      a validator for the value
      Throws:
      NullPointerException - if name is null
      IllegalArgumentException - if name contains whitespace or is empty
    • that

      <T> OptionalValidator<T> that(Optional<T> value, String name)
      Validates the state of an Optional.

      The returned validator throws an exception immediately if a validation fails. This exception is then converted into an AssertionError. Exceptions unrelated to validation failures are not converted.

      This method is intended to be used with the assert keyword, like so: assert that(value, name).

      Type Parameters:
      T - the type of optional
      Parameters:
      value - the value
      name - the name of the value
      Returns:
      a validator for the value
      Throws:
      NullPointerException - if name is null
      IllegalArgumentException - if name contains whitespace or is empty
    • that

      <T> OptionalValidator<T> that(Optional<T> value)
      Validates the state of an Optional.

      The returned validator throws an exception immediately if a validation fails. This exception is then converted into an AssertionError. Exceptions unrelated to validation failures are not converted.

      This method is intended to be used with the assert keyword, like so: assert that(value, name).

      Type Parameters:
      T - the type of optional
      Parameters:
      value - the value
      Returns:
      a validator for the value
    • that

      Validates the state of an InetAddress.

      The returned validator throws an exception immediately if a validation fails. This exception is then converted into an AssertionError. Exceptions unrelated to validation failures are not converted.

      This method is intended to be used with the assert keyword, like so: assert that(value, name).

      Parameters:
      value - the value
      name - the name of the value
      Returns:
      a validator for the value
      Throws:
      NullPointerException - if name is null
      IllegalArgumentException - if name contains whitespace or is empty
    • that

      Validates the state of an InetAddress.

      The returned validator throws an exception immediately if a validation fails. This exception is then converted into an AssertionError. Exceptions unrelated to validation failures are not converted.

      This method is intended to be used with the assert keyword, like so: assert that(value, name).

      Parameters:
      value - the value
      Returns:
      a validator for the value