Interface PrimitiveShortArrayValidator
- All Superinterfaces:
ArrayComponent<PrimitiveShortArrayValidator,,short[], Short> ObjectComponent<PrimitiveShortArrayValidator,,short[]> ValidatorComponent<PrimitiveShortArrayValidator,short[]>
public interface PrimitiveShortArrayValidator
extends ValidatorComponent<PrimitiveShortArrayValidator,short[]>, ObjectComponent<PrimitiveShortArrayValidator,short[]>, ArrayComponent<PrimitiveShortArrayValidator,short[],Short>
Validates the state of a
short[].-
Method Summary
Modifier and TypeMethodDescriptioncontains(short expected) Ensures that the array contains an element.Ensures that the array contains an element.doesNotContain(short unwanted) Ensures that the array does not containunwanted.doesNotContain(short unwanted, String name) Ensures that the array does not containunwanted.isSorted()Ensures that the array is sorted by its natural ordering.Methods declared in interface com.github.cowwoc.requirements10.java.validator.component.ArrayComponent
contains, contains, containsAll, containsAll, containsAll, containsAll, containsAny, containsAny, containsAny, containsAny, containsExactly, containsExactly, containsExactly, containsExactly, doesNotContain, doesNotContain, doesNotContainAll, doesNotContainAll, doesNotContainAll, doesNotContainAll, doesNotContainAny, doesNotContainAny, doesNotContainAny, doesNotContainAny, doesNotContainDuplicates, doesNotContainExactly, doesNotContainExactly, doesNotContainExactly, doesNotContainExactly, isEmpty, isNotEmpty, isSorted, lengthMethods 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
-
contains
Ensures that the array contains an element.- Parameters:
expected- the element- Returns:
- this
- Throws:
NullPointerException- if the value is nullIllegalArgumentException- if the array does not containexpected
-
contains
Ensures that the array contains an element.- Parameters:
expected- the elementname- the name of the element- Returns:
- this
- Throws:
NullPointerException- if the value ornameare nullIllegalArgumentException- if:nameis emptynamecontains whitespacenameis already in use by the value being validated or the validator context- the array does not contain
expected
-
doesNotContain
Ensures that the array does not containunwanted.- Parameters:
unwanted- the unwanted element- Returns:
- this
- Throws:
NullPointerException- if the value is nullIllegalArgumentException- if the array containsunwanted
-
doesNotContain
Ensures that the array does not containunwanted.- Parameters:
unwanted- the unwanted elementname- the name of the unwanted element- Returns:
- this
- Throws:
NullPointerException- if the value ornameare nullIllegalArgumentException- if:nameis emptynamecontains whitespacenameis already in use by the value being validated or the validator context- the array contains
unwanted
-
isSorted
PrimitiveShortArrayValidator isSorted()Ensures that the array is sorted by its natural ordering.- Returns:
- this
- Throws:
NullPointerException- if the value is null- See Also:
-