Class Assert.StringAsserter
java.lang.Object
tech.jhipster.lite.shared.error.domain.Assert.StringAsserter
- Enclosing class:
Assert
Asserter dedicated to
String assertions-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionmaxLength(int length) Ensure that the given input value is not over the given lengthminLength(int length) Ensure that the input value is at least of the given lengthnotBlank()Ensure that the value is not blank (null, empty or only whitespace)notNull()Ensure that the value is not nullEnsure that the value does not contain whitespace
-
Field Details
-
PATTERN_SPACE
-
-
Method Details
-
notNull
Ensure that the value is not null- Returns:
- The current asserter
- Throws:
MissingMandatoryValueException- if the value is null
-
notBlank
Ensure that the value is not blank (null, empty or only whitespace)- Returns:
- The current asserter
- Throws:
MissingMandatoryValueException- if the value is blank
-
noWhitespace
Ensure that the value does not contain whitespace- Returns:
- The current asserter
- Throws:
MissingMandatoryValueException- if the value contain whitespace
-
minLength
Ensure that the input value is at least of the given length- Parameters:
length- inclusive min length of theString- Returns:
- The current asserter
- Throws:
MissingMandatoryValueException- if the expected length is strictly positive and the value is nullStringTooShortException- if the value is shorter than min length
-
maxLength
Ensure that the given input value is not over the given length- Parameters:
length- inclusive max length of theString- Returns:
- The current asserter
- Throws:
StringTooLongException- if the value is longer than the max length
-