Package tech.jhipster.lite.error.domain
Class Assert.CollectionAsserter<T>
java.lang.Object
tech.jhipster.lite.error.domain.Assert.CollectionAsserter<T>
- Enclosing class:
- Assert
Asserter dedicated to
Collection assertions-
Method Summary
Modifier and TypeMethodDescriptionmaxSize(int maxSize) Ensure that the size of the given input value is not over the given sizeEnsure that no element in thisCollectionis nullnotEmpty()Ensure that the value is not empty (null or empty)notNull()Ensure that the value is not null
-
Method Details
-
notNull
Ensure that the value is not null- Returns:
- The current asserter
- Throws:
MissingMandatoryValueException- if the value is null
-
notEmpty
Ensure that the value is not empty (null or empty)- Returns:
- The current asserter
- Throws:
MissingMandatoryValueException- if the value is null or empty
-
maxSize
Ensure that the size of the given input value is not over the given size- Parameters:
maxSize- inclusive max size of theCollection- Returns:
- The current asserter
- Throws:
MissingMandatoryValueException- if the expected size is strictly positive and the value is nullTooManyElementsException- if the size of value is over the max size
-
noNullElement
Ensure that no element in thisCollectionis null- Returns:
- The current asserter
- Throws:
NullElementInCollectionException- if an element is null
-