Interface GuavaAssertThat
- All Known Subinterfaces:
GuavaValidators
AssertionError immediately on validation failure.-
Method Summary
Modifier and TypeMethodDescription<K, V, T extends com.google.common.collect.Multimap<K,V>>
MultimapValidator<T, K, V> assertThat(T value) Validates the state of aMultimap.<K, V, T extends com.google.common.collect.Multimap<K,V>>
MultimapValidator<T, K, V> assertThat(T value, String name) Validates the state of aMultimap.
-
Method Details
-
assertThat
<K, V, T extends com.google.common.collect.Multimap<K,V>> MultimapValidator<T,K, assertThatV> (T value, String name) Validates the state of aMultimap.The returned validator captures exceptions on validation failure rather than throwing them immediately. The exceptions are converted into an
AssertionErrorand can be retrieved or thrown once the validation completes. Exceptions unrelated to validation failures are thrown immediately.This method is intended to be used with the
assertkeyword, like so:assert that(value, name).- Type Parameters:
K- the type of keys in theMultimapV- the type of values in theMultimapT- the type of theMultimap- Parameters:
value- the valuename- the name of the value- Returns:
- a validator for the value
- Throws:
NullPointerException- ifnameis nullIllegalArgumentException- ifnamecontains whitespace, or is empty
-
assertThat
<K, V, T extends com.google.common.collect.Multimap<K,V>> MultimapValidator<T,K, assertThatV> (T value) Validates the state of aMultimap.The returned validator captures exceptions on validation failure rather than throwing them immediately. The exceptions are converted into an
AssertionErrorand can be retrieved or thrown once the validation completes. Exceptions unrelated to validation failures are thrown immediately.This method is intended to be used with the
assertkeyword, like so:assert that(value, name).- Type Parameters:
K- the type of keys in theMultimapV- the type of values in theMultimapT- the type of theMultimap- Parameters:
value- the value- Returns:
- a validator for the value
-