Interface MapValidator<T extends Map<K,V>,K,V>
- Type Parameters:
T- the type of the mapK- the type of keys in the mapV- the type of values in the map
- All Superinterfaces:
ObjectComponent<MapValidator<T,,K, V>, T> ValidatorComponent<MapValidator<T,K, V>, T>
public interface MapValidator<T extends Map<K,V>,K,V>
extends ValidatorComponent<MapValidator<T,K,V>,T>, ObjectComponent<MapValidator<T,K,V>,T>
Validates the state of a
Map.-
Method Summary
Modifier and TypeMethodDescriptionentrySet()Returns a validator for the value'sentries.MapValidator<T, K, V> isEmpty()Ensures that the value is empty.MapValidator<T, K, V> Ensures that the value is not empty.keySet()Returns a validator for the value'skeys.size()Returns a validator for the map'ssize.values()Returns a validator for the value'svalues.Methods declared in interface com.github.cowwoc.requirements10.java.validator.component.ObjectComponent
getValue, isEqualTo, isEqualTo, isInstanceOf, isInstanceOf, isNotEqualTo, isNotEqualTo, isNotInstanceOf, isNotInstanceOf, isNotNull, isNull, isReferenceEqualTo, isReferenceNotEqualToMethods declared in interface com.github.cowwoc.requirements10.java.validator.component.ValidatorComponent
and, elseGetFailures, elseThrow, getContext, getContextAsString, getName, getValueOrDefault, validationFailed, withContext
-
Method Details
-
keySet
CollectionValidator<Set<K>,K> keySet()Returns a validator for the value'skeys.- Returns:
- a validator for the value's
keys - Throws:
NullPointerException- if the value is null
-
values
CollectionValidator<Collection<V>,V> values()Returns a validator for the value'svalues.- Returns:
- a validator for the value's
values - Throws:
NullPointerException- if the value is null
-
entrySet
Returns a validator for the value'sentries.- Returns:
- a validator for the value's
entries - Throws:
NullPointerException- if the value is null
-
isEmpty
MapValidator<T,K, isEmpty()V> Ensures that the value is empty.- Returns:
- this
- Throws:
NullPointerException- if the value is nullIllegalArgumentException- if value is not empty
-
isNotEmpty
MapValidator<T,K, isNotEmpty()V> Ensures that the value is not empty.- Returns:
- this
- Throws:
NullPointerException- if the value is nullIllegalArgumentException- if value is empty
-
size
Returns a validator for the map'ssize.- Returns:
- a validator for the map's
size - Throws:
NullPointerException- if the value is null
-