Package com.github.cowwoc.requirements
Class DefaultRequirements
java.lang.Object
com.github.cowwoc.requirements.DefaultRequirements
Verifies requirements using the default 
configuration. Any method that exposes
 a Requirements instance is returning an independent copy. Any modifications applied to that
 copy are thrown away and do not affect the configuration of this class.
 
 To retain configuration changes, instantiate and reuse the same Requirements instance across
 multiple runs.
 
Thread-safety: This class is thread-safe.
- See Also:
 - 
RequirementsJavaRequirements
 
- 
Method Summary
Modifier and TypeMethodDescriptionstatic booleanReturns true if assertions are enabled for this class.static voidassertThat(Consumer<Requirements> requirements) Verifies requirements only if assertions are enabled.static <V> VassertThatAndReturn(Function<Requirements, V> requirements) Verifies requirements only ifassertions are enabled.Returns an unmodifiable map to append to the exception message.static StringgetContextMessage(String message) Returns the contextual information associated with this configuration.static booleanIndicates if stack trace references to this library should be removed.static booleanIndicates if exceptions should show the difference between the actual and expected values.static com.github.cowwoc.requirements.java.ArrayVerifier<boolean[],Boolean> requireThat(boolean[] actual, String name) Verifies the requirements of a primitivebooleanarray.static com.github.cowwoc.requirements.java.PrimitiveBooleanVerifierrequireThat(boolean actual, String name) Verifies the requirements of aboolean.static com.github.cowwoc.requirements.java.ArrayVerifier<byte[],Byte> requireThat(byte[] actual, String name) Verifies the requirements of a primitivebytearray.static com.github.cowwoc.requirements.java.PrimitiveNumberVerifier<Byte>requireThat(byte actual, String name) Verifies the requirements of abyte.static com.github.cowwoc.requirements.java.ArrayVerifier<char[],Character> requireThat(char[] actual, String name) Verifies the requirements of a primitivechararray.static com.github.cowwoc.requirements.java.PrimitiveCharacterVerifierrequireThat(char actual, String name) Verifies the requirements of achar.static com.github.cowwoc.requirements.java.ArrayVerifier<double[],Double> requireThat(double[] actual, String name) Verifies the requirements of a primitivedoublearray.static com.github.cowwoc.requirements.java.PrimitiveFloatingPointVerifier<Double>requireThat(double actual, String name) Verifies the requirements of adouble.static com.github.cowwoc.requirements.java.ArrayVerifier<float[],Float> requireThat(float[] actual, String name) Verifies the requirements of a primitivefloatarray.static com.github.cowwoc.requirements.java.PrimitiveFloatingPointVerifier<Float>requireThat(float actual, String name) Verifies the requirements of afloat.static com.github.cowwoc.requirements.java.ArrayVerifier<int[],Integer> requireThat(int[] actual, String name) Verifies the requirements of a primitiveintarray.static com.github.cowwoc.requirements.java.PrimitiveIntegerVerifier<Integer>requireThat(int actual, String name) Verifies the requirements of anint.static com.github.cowwoc.requirements.java.ArrayVerifier<long[],Long> requireThat(long[] actual, String name) Verifies the requirements of a primitivelongarray.static com.github.cowwoc.requirements.java.PrimitiveIntegerVerifier<Long>requireThat(long actual, String name) Verifies the requirements of along.static com.github.cowwoc.requirements.java.ArrayVerifier<short[],Short> requireThat(short[] actual, String name) Verifies the requirements of a primitiveshortarray.static com.github.cowwoc.requirements.java.PrimitiveNumberVerifier<Short>requireThat(short actual, String name) Verifies the requirements of ashort.static <C extends Collection<E>,E> 
com.github.cowwoc.requirements.java.CollectionVerifier<C,E> requireThat(C actual, String name) Verifies the requirements of aCollection.static <E> com.github.cowwoc.requirements.java.ArrayVerifier<E[],E> requireThat(E[] actual, String name) Verifies the requirements of anObjectarray.static com.github.cowwoc.requirements.java.BooleanVerifierrequireThat(Boolean actual, String name) Verifies the requirements of aBoolean.static <T> com.github.cowwoc.requirements.java.ClassVerifier<T>requireThat(Class<T> actual, String name) Verifies the requirements of aClass.static com.github.cowwoc.requirements.java.FloatingPointVerifier<Double>requireThat(Double actual, String name) Verifies the requirements of aDouble.static com.github.cowwoc.requirements.java.FloatingPointVerifier<Float>requireThat(Float actual, String name) Verifies the requirements of aFloat.static com.github.cowwoc.requirements.java.IntegerVerifier<Integer>requireThat(Integer actual, String name) Verifies the requirements of anInteger.static com.github.cowwoc.requirements.java.IntegerVerifier<Long>requireThat(Long actual, String name) Verifies the requirements of aLong.static com.github.cowwoc.requirements.java.StringVerifierrequireThat(String actual, String name) Verifies the requirements of aString.static com.github.cowwoc.requirements.java.BigDecimalVerifierrequireThat(BigDecimal actual, String name) Verifies the requirements of aBigDecimal.static com.github.cowwoc.requirements.java.InetAddressVerifierrequireThat(InetAddress actual, String name) Verifies the requirements of anInetAddress.static com.github.cowwoc.requirements.java.UriVerifierrequireThat(URI actual, String name) Verifies the requirements of aURI.static com.github.cowwoc.requirements.java.UrlVerifierrequireThat(URL actual, String name) Verifies the requirements of aURL.static com.github.cowwoc.requirements.java.PathVerifierrequireThat(Path actual, String name) Verifies the requirements of aPath.static <K,V> com.github.cowwoc.requirements.java.MapVerifier<K, V> requireThat(Map<K, V> actual, String name) Verifies the requirements of aMap.static com.github.cowwoc.requirements.java.OptionalVerifierrequireThat(Optional<?> actual, String name) Verifies the requirements of anOptional.static <L extends List<E>,E> 
com.github.cowwoc.requirements.java.ListVerifier<L,E> requireThat(L actual, String name) Verifies the requirements of aList.static <T> com.github.cowwoc.requirements.java.ObjectVerifier<T>requireThat(T actual, String name) Verifies the requirements of anObject.static StringReturns theStringrepresentation of an object.static com.github.cowwoc.requirements.java.ArrayValidator<boolean[],Boolean> validateThat(boolean[] actual, String name) Validates the requirements of a primitivebooleanarray.static com.github.cowwoc.requirements.java.PrimitiveBooleanValidatorvalidateThat(boolean actual, String name) Validates the requirements of aboolean.static com.github.cowwoc.requirements.java.ArrayValidator<byte[],Byte> validateThat(byte[] actual, String name) Validates the requirements of a primitivebytearray.static com.github.cowwoc.requirements.java.PrimitiveNumberValidator<Byte>validateThat(byte actual, String name) Validates the requirements of abyte.static com.github.cowwoc.requirements.java.ArrayValidator<char[],Character> validateThat(char[] actual, String name) Validates the requirements of a primitivechararray.static com.github.cowwoc.requirements.java.PrimitiveCharacterValidatorvalidateThat(char actual, String name) Validates the requirements of achar.static com.github.cowwoc.requirements.java.ArrayValidator<double[],Double> validateThat(double[] actual, String name) Validates the requirements of a primitivedoublearray.static com.github.cowwoc.requirements.java.PrimitiveFloatingPointValidator<Double>validateThat(double actual, String name) Validates the requirements of adouble.static com.github.cowwoc.requirements.java.ArrayValidator<float[],Float> validateThat(float[] actual, String name) Validates the requirements of a primitivefloatarray.static com.github.cowwoc.requirements.java.PrimitiveFloatingPointValidator<Float>validateThat(float actual, String name) Validates the requirements of afloat.static com.github.cowwoc.requirements.java.ArrayValidator<int[],Integer> validateThat(int[] actual, String name) Validates the requirements of a primitiveintarray.static com.github.cowwoc.requirements.java.PrimitiveIntegerValidator<Integer>validateThat(int actual, String name) Validates the requirements of anint.static com.github.cowwoc.requirements.java.ArrayValidator<long[],Long> validateThat(long[] actual, String name) Validates the requirements of a primitivelongarray.static com.github.cowwoc.requirements.java.PrimitiveIntegerValidator<Long>validateThat(long actual, String name) Validates the requirements of along.static com.github.cowwoc.requirements.java.ArrayValidator<short[],Short> validateThat(short[] actual, String name) Validates the requirements of a primitiveshortarray.static com.github.cowwoc.requirements.java.PrimitiveNumberValidator<Short>validateThat(short actual, String name) Validates the requirements of ashort.static <C extends Collection<E>,E> 
com.github.cowwoc.requirements.java.CollectionValidator<C,E> validateThat(C actual, String name) Validates the requirements of aCollection.static <E> com.github.cowwoc.requirements.java.ArrayValidator<E[],E> validateThat(E[] actual, String name) Validates the requirements of anObjectarray.static com.github.cowwoc.requirements.java.BooleanValidatorvalidateThat(Boolean actual, String name) Validates the requirements of aBoolean.static <T> com.github.cowwoc.requirements.java.ClassValidator<T>validateThat(Class<T> actual, String name) Validates the requirements of aClass.static com.github.cowwoc.requirements.java.FloatingPointValidator<Double>validateThat(Double actual, String name) Validates the requirements of aDouble.static com.github.cowwoc.requirements.java.FloatingPointValidator<Float>validateThat(Float actual, String name) Validates the requirements of aFloat.static com.github.cowwoc.requirements.java.IntegerValidator<Integer>validateThat(Integer actual, String name) Validates the requirements of anInteger.static com.github.cowwoc.requirements.java.IntegerValidator<Long>validateThat(Long actual, String name) Validates the requirements of aLong.static com.github.cowwoc.requirements.java.StringValidatorvalidateThat(String actual, String name) Validates the requirements of aString.static com.github.cowwoc.requirements.java.BigDecimalValidatorvalidateThat(BigDecimal actual, String name) Validates the requirements of aBigDecimal.static com.github.cowwoc.requirements.java.InetAddressValidatorvalidateThat(InetAddress actual, String name) Validates the requirements of anInetAddress.static com.github.cowwoc.requirements.java.UriValidatorvalidateThat(URI actual, String name) Validates the requirements of aURI.static com.github.cowwoc.requirements.java.UrlValidatorvalidateThat(URL actual, String name) Validates the requirements of aURL.static com.github.cowwoc.requirements.java.PathValidatorvalidateThat(Path actual, String name) Validates the requirements of aPath.static <K,V> com.github.cowwoc.requirements.java.MapValidator<K, V> validateThat(Map<K, V> actual, String name) Validates the requirements of aMap.static com.github.cowwoc.requirements.java.OptionalValidatorvalidateThat(Optional<?> actual, String name) Validates the requirements of anOptional.static <L extends List<E>,E> 
com.github.cowwoc.requirements.java.ListValidator<L,E> validateThat(L actual, String name) Validates the requirements of aList.static <T> com.github.cowwoc.requirements.java.ObjectValidator<T>validateThat(T actual, String name) Validates the requirements of anObject.static RequirementsIndicates thatassertThat()shouldn't do anything.static RequirementsIndicates thatassertThat()should verify requirements.static RequirementsIndicates that stack trace references to this library should be removed.static RequirementswithConfiguration(com.github.cowwoc.requirements.java.Configuration configuration) Replaces the configuration.static RequirementswithContext(String name, Object value) Adds or updates contextual information associated with the exception message.static RequirementswithDiff()Indicates that exceptions should show the difference between the actual and expected values.static RequirementsIndicates that stack trace references to this library should be kept.static RequirementsIndicates that exceptions should not show the difference between the actual and expected values.static <T> RequirementswithoutStringConverter(Class<T> type) Indicates that an object'stoString()method should be used to convert it to a String.static <T> RequirementswithStringConverter(Class<T> type, Function<T, String> converter) Indicates that a function should be used to convert an object to a String. 
- 
Method Details
- 
assertionsAreEnabled
public static boolean assertionsAreEnabled()Returns true if assertions are enabled for this class.- Returns:
 - true if assertions are enabled for this class
 
 - 
withAssertionsEnabled
Indicates thatassertThat()should verify requirements.- Returns:
 - a new 
Requirementsobject that operates independently of the original instance 
 - 
withAssertionsDisabled
Indicates thatassertThat()shouldn't do anything.- Returns:
 - a new 
Requirementsobject that operates independently of the original instance 
 - 
isDiffEnabled
public static boolean isDiffEnabled()Indicates if exceptions should show the difference between the actual and expected values.- Returns:
 - true by default
 
 - 
withDiff
Indicates that exceptions should show the difference between the actual and expected values.- Returns:
 - a new 
Requirementsobject that operates independently of the original instance 
 - 
withoutDiff
Indicates that exceptions should not show the difference between the actual and expected values.- Returns:
 - a new 
Requirementsobject that operates independently of the original instance 
 - 
isCleanStackTrace
public static boolean isCleanStackTrace()Indicates if stack trace references to this library should be removed.- Returns:
 trueby default- See Also:
 
 - 
withCleanStackTrace
Indicates that stack trace references to this library should be removed.- Returns:
 - a new 
Requirementsobject that operates independently of the original instance - See Also:
 
 - 
withoutCleanStackTrace
Indicates that stack trace references to this library should be kept.- Returns:
 - a new 
Requirementsobject that operates independently of the original instance - See Also:
 
 - 
getContext
Returns an unmodifiable map to append to the exception message.- Returns:
 - an empty map by default
 - See Also:
 
 - 
withContext
Adds or updates contextual information associated with the exception message. Overrides any values associated with thenameat theThreadRequirementslevel.- Parameters:
 name- the name of the parametervalue- the value of the parameter- Returns:
 - a new 
Requirementsobject that operates independently of the original instance - Throws:
 NullPointerException- ifnameis null
 - 
getContextMessage
Returns the contextual information associated with this configuration.- Parameters:
 message- the exception message (nullif absent)- Returns:
 - the contextual information associated with this configuration
 
 - 
toString
Returns theStringrepresentation of an object. By default, custom handlers are provided for arrays,Integer,Long,BigDecimal, andPath.- Parameters:
 value- a value- Returns:
 - the 
Stringrepresentation of the value - See Also:
 
 - 
withStringConverter
Indicates that a function should be used to convert an object to a String.Please note that
typemust be an exact match (e.g. configuring a converter forSetwill not match values of typeHashSet).- Type Parameters:
 T- the type of object being converted- Parameters:
 type- the type of object being converted (non-primitive arrays are mapped toObject[].class)converter- a function that converts an object of the specified type to a String- Returns:
 - a new 
Requirementsobject that operates independently of the original instance - Throws:
 NullPointerException- if any of the arguments are null
 - 
withoutStringConverter
Indicates that an object'stoString()method should be used to convert it to a String.- Type Parameters:
 T- the type of object being converted- Parameters:
 type- the type of object being converted- Returns:
 - a new 
Requirementsobject that operates independently of the original instance - Throws:
 NullPointerException- iftypeis null
 - 
withConfiguration
public static Requirements withConfiguration(com.github.cowwoc.requirements.java.Configuration configuration) Replaces the configuration.- Parameters:
 configuration- a new configuration- Returns:
 - a new 
Requirementsobject that operates independently of the original instance - Throws:
 NullPointerException- ifconfigurationis null
 - 
assertThatAndReturn
Verifies requirements only ifassertions are enabled.- Type Parameters:
 V- the return value of the operation- Parameters:
 requirements- the requirements to verify- Returns:
 - the return value of the operation, or 
nullif assertions are disabled - Throws:
 NullPointerException- ifrequirementsis null- See Also:
 
 - 
assertThat
Verifies requirements only if assertions are enabled.- Parameters:
 requirements- the requirements to verify- Throws:
 NullPointerException- ifrequirementsis null- See Also:
 
 - 
requireThat
public static <T> com.github.cowwoc.requirements.java.ObjectVerifier<T> requireThat(T actual, String name) Verifies the requirements of anObject.- Type Parameters:
 T- the type of the value- Parameters:
 actual- the actual valuename- the name of the value- Returns:
 - a verifier for the value
 - Throws:
 NullPointerException- ifnameis nullIllegalArgumentException- ifnameis blank
 - 
validateThat
public static <T> com.github.cowwoc.requirements.java.ObjectValidator<T> validateThat(T actual, String name) Validates the requirements of anObject.- Type Parameters:
 T- the type of the value- Parameters:
 actual- the actual valuename- the name of the value- Returns:
 - a validator for the value
 - Throws:
 NullPointerException- ifnameis nullIllegalArgumentException- ifnameis blank
 - 
requireThat
public static <C extends Collection<E>,E> com.github.cowwoc.requirements.java.CollectionVerifier<C,E> requireThat(C actual, String name) Verifies the requirements of aCollection.- Type Parameters:
 C- the type of the collectionE- the type of elements in the collection- Parameters:
 actual- the actual valuename- the name of the value- Returns:
 - a verifier for the value
 - Throws:
 NullPointerException- ifnameis nullIllegalArgumentException- ifnameis blank
 - 
validateThat
public static <C extends Collection<E>,E> com.github.cowwoc.requirements.java.CollectionValidator<C,E> validateThat(C actual, String name) Validates the requirements of aCollection.- Type Parameters:
 C- the type of the collectionE- the type of elements in the collection- Parameters:
 actual- the actual valuename- the name of the value- Returns:
 - a validator for the value
 - Throws:
 NullPointerException- ifnameis nullIllegalArgumentException- ifnameis blank
 - 
requireThat
public static <L extends List<E>,E> com.github.cowwoc.requirements.java.ListVerifier<L,E> requireThat(L actual, String name) Verifies the requirements of aList.- Type Parameters:
 L- the type of the listE- the type of elements in the list- Parameters:
 actual- the actual valuename- the name of the value- Returns:
 - a verifier for the value
 - Throws:
 NullPointerException- ifnameis nullIllegalArgumentException- ifnameis blank
 - 
validateThat
public static <L extends List<E>,E> com.github.cowwoc.requirements.java.ListValidator<L,E> validateThat(L actual, String name) Validates the requirements of aList.- Type Parameters:
 L- the type of the listE- the type of elements in the list- Parameters:
 actual- the actual valuename- the name of the value- Returns:
 - a validator for the value
 - Throws:
 NullPointerException- ifnameis nullIllegalArgumentException- ifnameis blank
 - 
requireThat
public static com.github.cowwoc.requirements.java.ArrayVerifier<byte[],Byte> requireThat(byte[] actual, String name) Verifies the requirements of a primitivebytearray.- Parameters:
 actual- the actual valuename- the name of the value- Returns:
 - a verifier for the value
 - Throws:
 NullPointerException- ifnameis nullIllegalArgumentException- ifnameis blank
 - 
validateThat
public static com.github.cowwoc.requirements.java.ArrayValidator<byte[],Byte> validateThat(byte[] actual, String name) Validates the requirements of a primitivebytearray.- Parameters:
 actual- the actual valuename- the name of the value- Returns:
 - a validator for the value
 - Throws:
 NullPointerException- ifnameis nullIllegalArgumentException- ifnameis blank
 - 
requireThat
public static com.github.cowwoc.requirements.java.ArrayVerifier<short[],Short> requireThat(short[] actual, String name) Verifies the requirements of a primitiveshortarray.- Parameters:
 actual- the actual valuename- the name of the value- Returns:
 - a verifier for the value
 - Throws:
 NullPointerException- ifnameis nullIllegalArgumentException- ifnameis blank
 - 
validateThat
public static com.github.cowwoc.requirements.java.ArrayValidator<short[],Short> validateThat(short[] actual, String name) Validates the requirements of a primitiveshortarray.- Parameters:
 actual- the actual valuename- the name of the value- Returns:
 - a validator for the value
 - Throws:
 NullPointerException- ifnameis nullIllegalArgumentException- ifnameis blank
 - 
requireThat
public static com.github.cowwoc.requirements.java.ArrayVerifier<int[],Integer> requireThat(int[] actual, String name) Verifies the requirements of a primitiveintarray.- Parameters:
 actual- the actual valuename- the name of the value- Returns:
 - a verifier for the value
 - Throws:
 NullPointerException- ifnameis nullIllegalArgumentException- ifnameis blank
 - 
validateThat
public static com.github.cowwoc.requirements.java.ArrayValidator<int[],Integer> validateThat(int[] actual, String name) Validates the requirements of a primitiveintarray.- Parameters:
 actual- the actual valuename- the name of the value- Returns:
 - a validator for the value
 - Throws:
 NullPointerException- ifnameis nullIllegalArgumentException- ifnameis blank
 - 
requireThat
public static com.github.cowwoc.requirements.java.ArrayVerifier<long[],Long> requireThat(long[] actual, String name) Verifies the requirements of a primitivelongarray.- Parameters:
 actual- the actual valuename- the name of the value- Returns:
 - a verifier for the value
 - Throws:
 NullPointerException- ifnameis nullIllegalArgumentException- ifnameis blank
 - 
validateThat
public static com.github.cowwoc.requirements.java.ArrayValidator<long[],Long> validateThat(long[] actual, String name) Validates the requirements of a primitivelongarray.- Parameters:
 actual- the actual valuename- the name of the value- Returns:
 - a validator for the value
 - Throws:
 NullPointerException- ifnameis nullIllegalArgumentException- ifnameis blank
 - 
requireThat
public static com.github.cowwoc.requirements.java.ArrayVerifier<float[],Float> requireThat(float[] actual, String name) Verifies the requirements of a primitivefloatarray.- Parameters:
 actual- the actual valuename- the name of the value- Returns:
 - a verifier for the value
 - Throws:
 NullPointerException- ifnameis nullIllegalArgumentException- ifnameis blank
 - 
validateThat
public static com.github.cowwoc.requirements.java.ArrayValidator<float[],Float> validateThat(float[] actual, String name) Validates the requirements of a primitivefloatarray.- Parameters:
 actual- the actual valuename- the name of the value- Returns:
 - a validator for the value
 - Throws:
 NullPointerException- ifnameis nullIllegalArgumentException- ifnameis blank
 - 
requireThat
public static com.github.cowwoc.requirements.java.ArrayVerifier<double[],Double> requireThat(double[] actual, String name) Verifies the requirements of a primitivedoublearray.- Parameters:
 actual- the actual valuename- the name of the value- Returns:
 - a verifier for the value
 - Throws:
 NullPointerException- ifnameis nullIllegalArgumentException- ifnameis blank
 - 
validateThat
public static com.github.cowwoc.requirements.java.ArrayValidator<double[],Double> validateThat(double[] actual, String name) Validates the requirements of a primitivedoublearray.- Parameters:
 actual- the actual valuename- the name of the value- Returns:
 - a validator for the value
 - Throws:
 NullPointerException- ifnameis nullIllegalArgumentException- ifnameis blank
 - 
requireThat
public static com.github.cowwoc.requirements.java.ArrayVerifier<boolean[],Boolean> requireThat(boolean[] actual, String name) Verifies the requirements of a primitivebooleanarray.- Parameters:
 actual- the actual valuename- the name of the value- Returns:
 - a verifier for the value
 - Throws:
 NullPointerException- ifnameis nullIllegalArgumentException- ifnameis blank
 - 
validateThat
public static com.github.cowwoc.requirements.java.ArrayValidator<boolean[],Boolean> validateThat(boolean[] actual, String name) Validates the requirements of a primitivebooleanarray.- Parameters:
 actual- the actual valuename- the name of the value- Returns:
 - a validator for the value
 - Throws:
 NullPointerException- ifnameis nullIllegalArgumentException- ifnameis blank
 - 
requireThat
public static com.github.cowwoc.requirements.java.ArrayVerifier<char[],Character> requireThat(char[] actual, String name) Verifies the requirements of a primitivechararray.- Parameters:
 actual- the actual valuename- the name of the value- Returns:
 - a verifier for the value
 - Throws:
 NullPointerException- ifnameis nullIllegalArgumentException- ifnameis blank
 - 
validateThat
public static com.github.cowwoc.requirements.java.ArrayValidator<char[],Character> validateThat(char[] actual, String name) Validates the requirements of a primitivechararray.- Parameters:
 actual- the actual valuename- the name of the value- Returns:
 - a validator for the value
 - Throws:
 NullPointerException- ifnameis nullIllegalArgumentException- ifnameis blank
 - 
requireThat
public static <E> com.github.cowwoc.requirements.java.ArrayVerifier<E[],E> requireThat(E[] actual, String name) Verifies the requirements of anObjectarray.- Type Parameters:
 E- the type of elements in the array- Parameters:
 actual- the actual valuename- the name of the value- Returns:
 - a verifier for the value
 - Throws:
 NullPointerException- ifnameis nullIllegalArgumentException- ifnameis blank
 - 
validateThat
public static <E> com.github.cowwoc.requirements.java.ArrayValidator<E[],E> validateThat(E[] actual, String name) Validates the requirements of anObjectarray.- Type Parameters:
 E- the type of elements in the array- Parameters:
 actual- the actual valuename- the name of the value- Returns:
 - a validator for the value
 - Throws:
 NullPointerException- ifnameis nullIllegalArgumentException- ifnameis blank
 - 
requireThat
public static <T extends Comparable<? super T>> com.github.cowwoc.requirements.java.ComparableVerifier<T> requireThat(T actual, String name) Verifies the requirements of aComparable.- Type Parameters:
 T- the type of objects that the value may be compared to- Parameters:
 actual- the actual valuename- the name of the value- Returns:
 - a verifier for the value
 - Throws:
 NullPointerException- ifnameis nullIllegalArgumentException- ifnameis blank
 - 
validateThat
public static <T extends Comparable<? super T>> com.github.cowwoc.requirements.java.ComparableValidator<T> validateThat(T actual, String name) Validates the requirements of aComparable.- Type Parameters:
 T- the type of objects that the value may be compared to- Parameters:
 actual- the actual valuename- the name of the value- Returns:
 - a validator for the value
 - Throws:
 NullPointerException- ifnameis nullIllegalArgumentException- ifnameis blank
 - 
requireThat
public static com.github.cowwoc.requirements.java.PrimitiveNumberVerifier<Byte> requireThat(byte actual, String name) Verifies the requirements of abyte.- Parameters:
 actual- the actual valuename- the name of the value- Returns:
 - a verifier for the value
 - Throws:
 NullPointerException- ifnameis nullIllegalArgumentException- ifnameis blank
 - 
validateThat
public static com.github.cowwoc.requirements.java.PrimitiveNumberValidator<Byte> validateThat(byte actual, String name) Validates the requirements of abyte.- Parameters:
 actual- the actual valuename- the name of the value- Returns:
 - a validator for the value
 - Throws:
 NullPointerException- ifnameis nullIllegalArgumentException- ifnameis blank
 - 
requireThat
public static com.github.cowwoc.requirements.java.PrimitiveNumberVerifier<Short> requireThat(short actual, String name) Verifies the requirements of ashort.- Parameters:
 actual- the actual valuename- the name of the value- Returns:
 - a verifier for the value
 - Throws:
 NullPointerException- ifnameis nullIllegalArgumentException- ifnameis blank
 - 
validateThat
public static com.github.cowwoc.requirements.java.PrimitiveNumberValidator<Short> validateThat(short actual, String name) Validates the requirements of ashort.- Parameters:
 actual- the actual valuename- the name of the value- Returns:
 - a validator for the value
 - Throws:
 NullPointerException- ifnameis nullIllegalArgumentException- ifnameis blank
 - 
requireThat
public static com.github.cowwoc.requirements.java.PrimitiveIntegerVerifier<Integer> requireThat(int actual, String name) Verifies the requirements of anint.- Parameters:
 actual- the actual valuename- the name of the value- Returns:
 - a verifier for the value
 - Throws:
 NullPointerException- ifnameis nullIllegalArgumentException- ifnameis blank
 - 
validateThat
public static com.github.cowwoc.requirements.java.PrimitiveIntegerValidator<Integer> validateThat(int actual, String name) Validates the requirements of anint.- Parameters:
 actual- the actual valuename- the name of the value- Returns:
 - a validator for the value
 - Throws:
 NullPointerException- ifnameis nullIllegalArgumentException- ifnameis blank
 - 
requireThat
public static com.github.cowwoc.requirements.java.IntegerVerifier<Integer> requireThat(Integer actual, String name) Verifies the requirements of anInteger.- Parameters:
 actual- the actual valuename- the name of the value- Returns:
 - a verifier for the value
 - Throws:
 NullPointerException- ifnameis nullIllegalArgumentException- ifnameis blank
 - 
validateThat
public static com.github.cowwoc.requirements.java.IntegerValidator<Integer> validateThat(Integer actual, String name) Validates the requirements of anInteger.- Parameters:
 actual- the actual valuename- the name of the value- Returns:
 - a validator for the value
 - Throws:
 NullPointerException- ifnameis nullIllegalArgumentException- ifnameis blank
 - 
requireThat
public static com.github.cowwoc.requirements.java.PrimitiveIntegerVerifier<Long> requireThat(long actual, String name) Verifies the requirements of along.- Parameters:
 actual- the actual valuename- the name of the value- Returns:
 - a verifier for the value
 - Throws:
 NullPointerException- ifnameis nullIllegalArgumentException- ifnameis blank
 - 
validateThat
public static com.github.cowwoc.requirements.java.PrimitiveIntegerValidator<Long> validateThat(long actual, String name) Validates the requirements of along.- Parameters:
 actual- the actual valuename- the name of the value- Returns:
 - a validator for the value
 - Throws:
 NullPointerException- ifnameis nullIllegalArgumentException- ifnameis blank
 - 
requireThat
public static com.github.cowwoc.requirements.java.IntegerVerifier<Long> requireThat(Long actual, String name) Verifies the requirements of aLong.- Parameters:
 actual- the actual valuename- the name of the value- Returns:
 - a verifier for the value
 - Throws:
 NullPointerException- ifnameis nullIllegalArgumentException- ifnameis blank
 - 
validateThat
public static com.github.cowwoc.requirements.java.IntegerValidator<Long> validateThat(Long actual, String name) Validates the requirements of aLong.- Parameters:
 actual- the actual valuename- the name of the value- Returns:
 - a validator for the value
 - Throws:
 NullPointerException- ifnameis nullIllegalArgumentException- ifnameis blank
 - 
requireThat
public static com.github.cowwoc.requirements.java.PrimitiveFloatingPointVerifier<Float> requireThat(float actual, String name) Verifies the requirements of afloat.- Parameters:
 actual- the actual valuename- the name of the value- Returns:
 - a verifier for the value
 - Throws:
 NullPointerException- ifnameis nullIllegalArgumentException- ifnameis blank
 - 
validateThat
public static com.github.cowwoc.requirements.java.PrimitiveFloatingPointValidator<Float> validateThat(float actual, String name) Validates the requirements of afloat.- Parameters:
 actual- the actual valuename- the name of the value- Returns:
 - a validator for the value
 - Throws:
 NullPointerException- ifnameis nullIllegalArgumentException- ifnameis blank
 - 
requireThat
public static com.github.cowwoc.requirements.java.PrimitiveFloatingPointVerifier<Double> requireThat(double actual, String name) Verifies the requirements of adouble.- Parameters:
 actual- the actual valuename- the name of the value- Returns:
 - a verifier for the value
 - Throws:
 NullPointerException- ifnameis nullIllegalArgumentException- ifnameis blank
 - 
validateThat
public static com.github.cowwoc.requirements.java.PrimitiveFloatingPointValidator<Double> validateThat(double actual, String name) Validates the requirements of adouble.- Parameters:
 actual- the actual valuename- the name of the value- Returns:
 - a validator for the value
 - Throws:
 NullPointerException- ifnameis nullIllegalArgumentException- ifnameis blank
 - 
requireThat
public static com.github.cowwoc.requirements.java.PrimitiveBooleanVerifier requireThat(boolean actual, String name) Verifies the requirements of aboolean.- Parameters:
 actual- the actual valuename- the name of the value- Returns:
 - a verifier for the value
 - Throws:
 NullPointerException- ifnameis nullIllegalArgumentException- ifnameis blank
 - 
validateThat
public static com.github.cowwoc.requirements.java.PrimitiveBooleanValidator validateThat(boolean actual, String name) Validates the requirements of aboolean.- Parameters:
 actual- the actual valuename- the name of the value- Returns:
 - a validator for the value
 - Throws:
 NullPointerException- ifnameis nullIllegalArgumentException- ifnameis blank
 - 
requireThat
public static com.github.cowwoc.requirements.java.PrimitiveCharacterVerifier requireThat(char actual, String name) Verifies the requirements of achar.- Parameters:
 actual- the actual valuename- the name of the value- Returns:
 - a verifier for the value
 - Throws:
 NullPointerException- ifnameis nullIllegalArgumentException- ifnameis blank
 - 
validateThat
public static com.github.cowwoc.requirements.java.PrimitiveCharacterValidator validateThat(char actual, String name) Validates the requirements of achar.- Parameters:
 actual- the actual valuename- the name of the value- Returns:
 - a validator for the value
 - Throws:
 NullPointerException- ifnameis nullIllegalArgumentException- ifnameis blank
 - 
requireThat
public static <T extends Number & Comparable<? super T>> com.github.cowwoc.requirements.java.NumberVerifier<T> requireThat(T actual, String name) Verifies the requirements of aNumber.- Type Parameters:
 T- the type of the number- Parameters:
 actual- the actual valuename- the name of the value- Returns:
 - a verifier for the value
 - Throws:
 NullPointerException- ifnameis nullIllegalArgumentException- ifnameis blank
 - 
validateThat
public static <T extends Number & Comparable<? super T>> com.github.cowwoc.requirements.java.NumberValidator<T> validateThat(T actual, String name) Validates the requirements of aNumber.- Type Parameters:
 T- the type of the number- Parameters:
 actual- the actual valuename- the name of the value- Returns:
 - a validator for the value
 - Throws:
 NullPointerException- ifnameis nullIllegalArgumentException- ifnameis blank
 - 
requireThat
public static com.github.cowwoc.requirements.java.BooleanVerifier requireThat(Boolean actual, String name) Verifies the requirements of aBoolean.- Parameters:
 actual- the actual valuename- the name of the value- Returns:
 - a verifier for the value
 - Throws:
 NullPointerException- ifnameis nullIllegalArgumentException- ifnameis blank
 - 
validateThat
public static com.github.cowwoc.requirements.java.BooleanValidator validateThat(Boolean actual, String name) Validates the requirements of aBoolean.- Parameters:
 actual- the actual valuename- the name of the value- Returns:
 - a validator for the value
 - Throws:
 NullPointerException- ifnameis nullIllegalArgumentException- ifnameis blank
 - 
requireThat
public static com.github.cowwoc.requirements.java.FloatingPointVerifier<Float> requireThat(Float actual, String name) Verifies the requirements of aFloat.- Parameters:
 actual- the actual valuename- the name of the value- Returns:
 - a verifier for the value
 - Throws:
 NullPointerException- ifnameis nullIllegalArgumentException- ifnameis blank
 - 
validateThat
public static com.github.cowwoc.requirements.java.FloatingPointValidator<Float> validateThat(Float actual, String name) Validates the requirements of aFloat.- Parameters:
 actual- the actual valuename- the name of the value- Returns:
 - a validator for the value
 - Throws:
 NullPointerException- ifnameis nullIllegalArgumentException- ifnameis blank
 - 
requireThat
public static com.github.cowwoc.requirements.java.FloatingPointVerifier<Double> requireThat(Double actual, String name) Verifies the requirements of aDouble.- Parameters:
 actual- the actual valuename- the name of the value- Returns:
 - a verifier for the value
 - Throws:
 NullPointerException- ifnameis nullIllegalArgumentException- ifnameis blank
 - 
validateThat
public static com.github.cowwoc.requirements.java.FloatingPointValidator<Double> validateThat(Double actual, String name) Validates the requirements of aDouble.- Parameters:
 actual- the actual valuename- the name of the value- Returns:
 - a validator for the value
 - Throws:
 NullPointerException- ifnameis nullIllegalArgumentException- ifnameis blank
 - 
requireThat
public static com.github.cowwoc.requirements.java.BigDecimalVerifier requireThat(BigDecimal actual, String name) Verifies the requirements of aBigDecimal.- Parameters:
 actual- the actual valuename- the name of the value- Returns:
 - a verifier for the value
 - Throws:
 NullPointerException- ifnameis nullIllegalArgumentException- ifnameis blank
 - 
validateThat
public static com.github.cowwoc.requirements.java.BigDecimalValidator validateThat(BigDecimal actual, String name) Validates the requirements of aBigDecimal.- Parameters:
 actual- the actual valuename- the name of the value- Returns:
 - a validator for the value
 - Throws:
 NullPointerException- ifnameis nullIllegalArgumentException- ifnameis blank
 - 
requireThat
public static <K,V> com.github.cowwoc.requirements.java.MapVerifier<K,V> requireThat(Map<K, V> actual, String name) Verifies the requirements of aMap.- Type Parameters:
 K- the type of key in the mapV- the type of value in the map- Parameters:
 actual- the actual valuename- the name of the value- Returns:
 - a verifier for the value
 - Throws:
 NullPointerException- ifnameis nullIllegalArgumentException- ifnameis blank
 - 
validateThat
public static <K,V> com.github.cowwoc.requirements.java.MapValidator<K,V> validateThat(Map<K, V> actual, String name) Validates the requirements of aMap.- Type Parameters:
 K- the type of key in the mapV- the type of value in the map- Parameters:
 actual- the actual valuename- the name of the value- Returns:
 - a validator for the value
 - Throws:
 NullPointerException- ifnameis nullIllegalArgumentException- ifnameis blank
 - 
requireThat
public static com.github.cowwoc.requirements.java.PathVerifier requireThat(Path actual, String name) Verifies the requirements of aPath.- Parameters:
 actual- the actual valuename- the name of the value- Returns:
 - a verifier for the value
 - Throws:
 NullPointerException- ifnameis nullIllegalArgumentException- ifnameis blank
 - 
validateThat
public static com.github.cowwoc.requirements.java.PathValidator validateThat(Path actual, String name) Validates the requirements of aPath.- Parameters:
 actual- the actual valuename- the name of the value- Returns:
 - a validator for the value
 - Throws:
 NullPointerException- ifnameis nullIllegalArgumentException- ifnameis blank
 - 
requireThat
public static com.github.cowwoc.requirements.java.StringVerifier requireThat(String actual, String name) Verifies the requirements of aString.- Parameters:
 actual- the actual valuename- the name of the value- Returns:
 - a verifier for the value
 - Throws:
 NullPointerException- ifnameis nullIllegalArgumentException- ifnameis blank
 - 
validateThat
public static com.github.cowwoc.requirements.java.StringValidator validateThat(String actual, String name) Validates the requirements of aString.- Parameters:
 actual- the actual valuename- the name of the value- Returns:
 - a validator for the value
 - Throws:
 NullPointerException- ifnameis nullIllegalArgumentException- ifnameis blank
 - 
requireThat
Verifies the requirements of aURI.- Parameters:
 actual- the actual valuename- the name of the value- Returns:
 - a verifier for the value
 - Throws:
 NullPointerException- ifnameis nullIllegalArgumentException- ifnameis blank
 - 
validateThat
public static com.github.cowwoc.requirements.java.UriValidator validateThat(URI actual, String name) Validates the requirements of aURI.- Parameters:
 actual- the actual valuename- the name of the value- Returns:
 - a validator for the value
 - Throws:
 NullPointerException- ifnameis nullIllegalArgumentException- ifnameis blank
 - 
requireThat
Verifies the requirements of aURL.- Parameters:
 actual- the actual valuename- the name of the value- Returns:
 - a verifier for the value
 - Throws:
 NullPointerException- ifnameis nullIllegalArgumentException- ifnameis blank
 - 
validateThat
public static com.github.cowwoc.requirements.java.UrlValidator validateThat(URL actual, String name) Validates the requirements of aURL.- Parameters:
 actual- the actual valuename- the name of the value- Returns:
 - a validator for the value
 - Throws:
 NullPointerException- ifnameis nullIllegalArgumentException- ifnameis blank
 - 
requireThat
public static <T> com.github.cowwoc.requirements.java.ClassVerifier<T> requireThat(Class<T> actual, String name) Verifies the requirements of aClass.- Type Parameters:
 T- the type of class- Parameters:
 actual- the actual valuename- the name of the value- Returns:
 - a verifier for the value
 - Throws:
 NullPointerException- ifnameis nullIllegalArgumentException- ifnameis blank
 - 
validateThat
public static <T> com.github.cowwoc.requirements.java.ClassValidator<T> validateThat(Class<T> actual, String name) Validates the requirements of aClass.- Type Parameters:
 T- the type of class- Parameters:
 actual- the actual valuename- the name of the value- Returns:
 - a validator for the value
 - Throws:
 NullPointerException- ifnameis nullIllegalArgumentException- ifnameis blank
 - 
requireThat
public static com.github.cowwoc.requirements.java.OptionalVerifier requireThat(Optional<?> actual, String name) Verifies the requirements of anOptional.- Parameters:
 actual- the actual valuename- the name of the value- Returns:
 - a verifier for the value
 - Throws:
 NullPointerException- ifnameis nullIllegalArgumentException- ifnameis blank
 - 
validateThat
public static com.github.cowwoc.requirements.java.OptionalValidator validateThat(Optional<?> actual, String name) Validates the requirements of anOptional.- Parameters:
 actual- the actual valuename- the name of the value- Returns:
 - a validator for the value
 - Throws:
 NullPointerException- ifnameis nullIllegalArgumentException- ifnameis blank
 - 
requireThat
public static com.github.cowwoc.requirements.java.InetAddressVerifier requireThat(InetAddress actual, String name) Verifies the requirements of anInetAddress.- Parameters:
 actual- the actual valuename- the name of the value- Returns:
 - a verifier for the value
 - Throws:
 NullPointerException- ifnameis nullIllegalArgumentException- ifnameis blank
 - 
validateThat
public static com.github.cowwoc.requirements.java.InetAddressValidator validateThat(InetAddress actual, String name) Validates the requirements of anInetAddress.- Parameters:
 actual- the actual valuename- the name of the value- Returns:
 - a validator for the value
 - Throws:
 NullPointerException- ifnameis nullIllegalArgumentException- ifnameis blank
 
 -