public final class ValidationMessages
extends org.mule.runtime.api.i18n.I18nMessageFactory
I18nMessageFactory that provides the feedback messages for the Validators that are provided out of the box.
By default, it uses a default bundle with the default messages in english language, but it is also possible to provide a custom
bundle and Locale| Constructor and Description |
|---|
ValidationMessages()
Creates an instance which uses the default english language bundle which ships with the module
|
ValidationMessages(String bundlePath,
String locale)
Creates an instance which points to the given
bundlePath and locale |
| Modifier and Type | Method and Description |
|---|---|
org.mule.runtime.api.i18n.I18nMessage |
collectionIsEmpty()
Generates a
I18nMessage for a value that was expected to be not empty but was |
org.mule.runtime.api.i18n.I18nMessage |
collectionIsNotEmpty()
Generates a
I18nMessage for a Collection which was expected to be empty but wasn't |
org.mule.runtime.api.i18n.I18nMessage |
elapsedTime(LocalDateTime createdTime,
Duration expiresIn,
LocalDateTime currentTime)
Generates a
I18nMessage for an elapsed time $createdTime that exceeded duration
$expiresIn after $currentTime. |
org.mule.runtime.api.i18n.I18nMessage |
failedBooleanValidation(boolean value,
boolean expected)
Generates a
I18nMessage for a boolean validation that failed |
protected ResourceBundle |
getBundle(String bundlePath) |
org.mule.runtime.api.i18n.I18nMessage |
greaterThan(Object value,
Object boundary)
Returns a message for a
value that was expected to be greater than boundary but isn't |
org.mule.runtime.api.i18n.I18nMessage |
greaterThanMaxSize(Object value,
int maxSize,
int actualSize)
Generates a
I18nMessage for a value that was expected to have a maximum size but didn't |
org.mule.runtime.api.i18n.I18nMessage |
invalidEmail(String email)
Generates a
I18nMessage for an email validation that failed |
org.mule.runtime.api.i18n.I18nMessage |
invalidIp(String ip)
Generates a
I18nMessage for an ip address validation that failed |
org.mule.runtime.api.i18n.I18nMessage |
invalidNumberType(Object value,
String numberType)
Generates a
I18nMessage for a number type validation that failed |
org.mule.runtime.api.i18n.I18nMessage |
invalidTime(String time,
String locale,
String pattern)
Generates a
I18nMessage for a time expressed as a String but couldn't be parsed using the given
locale and pattern |
org.mule.runtime.api.i18n.I18nMessage |
invalidUrl(String url)
Generates a
I18nMessage for a url that is not valid |
org.mule.runtime.api.i18n.I18nMessage |
lowerThan(Object value,
Object boundary)
Returns a message for a
value that was expected to be lower than boundary but isn't |
org.mule.runtime.api.i18n.I18nMessage |
lowerThanMinSize(Object value,
int minSize,
int actualSize)
Generates a
I18nMessage for a value that was expected to have a minimum size but didn't |
org.mule.runtime.api.i18n.I18nMessage |
mapIsEmpty()
Generates a
I18nMessage for a map that was expected to be not empty but was |
org.mule.runtime.api.i18n.I18nMessage |
mapIsNotEmpty()
Generates a
I18nMessage for a Map which was expected to be empty but wasn't |
org.mule.runtime.api.i18n.I18nMessage |
notElapsedTime(LocalDateTime createdTime,
Duration expiresIn,
LocalDateTime currentTime)
Generates a
I18nMessage for an elapsed time $createdTime that did not exceeded duration
$expiresIn after $currentTime. |
org.mule.runtime.api.i18n.I18nMessage |
regexDoesNotMatch(String value,
String regex)
Generates a
I18nMessage for a value which doesn't match a given regex |
org.mule.runtime.api.i18n.I18nMessage |
rejectedIp(String ip)
Generates a
I18nMessage for an ip address filter validation that failed |
org.mule.runtime.api.i18n.I18nMessage |
stringIsBlank()
Generates a
I18nMessage for a string that was expected to be not blank but wasn't |
org.mule.runtime.api.i18n.I18nMessage |
stringIsNotBlank()
Generates a
I18nMessage for a String which was expected to be blank but wasn't |
org.mule.runtime.api.i18n.I18nMessage |
valueIsNull()
Generates a
I18nMessage for a value that is null what it wasn't expected to be |
org.mule.runtime.api.i18n.I18nMessage |
wasExpectingNull()
Generates a
I18nMessage for a value that was expected to be null but wasn't |
public ValidationMessages()
protected ResourceBundle getBundle(String bundlePath)
getBundle in class org.mule.runtime.api.i18n.I18nMessageFactorypublic org.mule.runtime.api.i18n.I18nMessage failedBooleanValidation(boolean value,
boolean expected)
I18nMessage for a boolean validation that failedvalue - the value that was obtainedexpected - the value that was expectedI18nMessagepublic org.mule.runtime.api.i18n.I18nMessage invalidNumberType(Object value, String numberType)
I18nMessage for a number type validation that failedvalue - the value that was testednumberType - the type that the tested value was expected to haveI18nMessagepublic org.mule.runtime.api.i18n.I18nMessage lowerThan(Object value, Object boundary)
value that was expected to be lower than boundary but isn'tvalue - the valueboundary - the boundaryI18nMessagepublic org.mule.runtime.api.i18n.I18nMessage greaterThan(Object value, Object boundary)
value that was expected to be greater than boundary but isn'tvalue - the valueboundary - the boundaryI18nMessagepublic org.mule.runtime.api.i18n.I18nMessage invalidEmail(String email)
I18nMessage for an email validation that failedemail - the validated email addressI18nMessagepublic org.mule.runtime.api.i18n.I18nMessage invalidIp(String ip)
I18nMessage for an ip address validation that failedip - the validated ip addressI18nMessagepublic org.mule.runtime.api.i18n.I18nMessage rejectedIp(String ip)
I18nMessage for an ip address filter validation that failedip - the rejected ip addressI18nMessagepublic org.mule.runtime.api.i18n.I18nMessage lowerThanMinSize(Object value, int minSize, int actualSize)
I18nMessage for a value that was expected to have a minimum size but didn'tvalue - the tested valueminSize - the minimum boundary used in the validationactualSize - the actual value sizeI18nMessagepublic org.mule.runtime.api.i18n.I18nMessage greaterThanMaxSize(Object value, int maxSize, int actualSize)
I18nMessage for a value that was expected to have a maximum size but didn'tvalue - the tested valuemaxSize - the maximum boundary used in the validationactualSize - the actual value sizeI18nMessagepublic org.mule.runtime.api.i18n.I18nMessage valueIsNull()
I18nMessage for a value that is null what it wasn't expected to beI18nMessagepublic org.mule.runtime.api.i18n.I18nMessage collectionIsEmpty()
I18nMessage for a value that was expected to be not empty but wasI18nMessagepublic org.mule.runtime.api.i18n.I18nMessage stringIsBlank()
I18nMessage for a string that was expected to be not blank but wasn'tI18nMessagepublic org.mule.runtime.api.i18n.I18nMessage mapIsEmpty()
I18nMessage for a map that was expected to be not empty but wasI18nMessagepublic org.mule.runtime.api.i18n.I18nMessage wasExpectingNull()
I18nMessage for a value that was expected to be null but wasn'tI18nMessagepublic org.mule.runtime.api.i18n.I18nMessage invalidTime(String time, String locale, String pattern)
I18nMessage for a time expressed as a String but couldn't be parsed using the given
locale and patterntime - the String that couldn't be parsedlocale - the locale that was used when parsingpattern - the pattern that was used when parsingI18nMessagepublic org.mule.runtime.api.i18n.I18nMessage elapsedTime(LocalDateTime createdTime, Duration expiresIn, LocalDateTime currentTime)
I18nMessage for an elapsed time $createdTime that exceeded duration
$expiresIn after $currentTime.createdTime - the original time to verifyexpiresIn - maximum allowed difference between the created and actual timecurrentTime - the time used to validate againstI18nMessagepublic org.mule.runtime.api.i18n.I18nMessage notElapsedTime(LocalDateTime createdTime, Duration expiresIn, LocalDateTime currentTime)
I18nMessage for an elapsed time $createdTime that did not exceeded duration
$expiresIn after $currentTime.createdTime - the original time to verifyexpiresIn - minimum allowed difference between the created and actual timecurrentTime - the time used to validate againstI18nMessagepublic org.mule.runtime.api.i18n.I18nMessage invalidUrl(String url)
I18nMessage for a url that is not validurl - the tested urlI18nMessagepublic org.mule.runtime.api.i18n.I18nMessage regexDoesNotMatch(String value, String regex)
I18nMessage for a value which doesn't match a given regexvalue - the tested valueregex - the regex that the value was tested againstI18nMessagepublic org.mule.runtime.api.i18n.I18nMessage stringIsNotBlank()
I18nMessage for a String which was expected to be blank but wasn'tI18nMessagepublic org.mule.runtime.api.i18n.I18nMessage collectionIsNotEmpty()
I18nMessage for a Collection which was expected to be empty but wasn'tI18nMessagepublic org.mule.runtime.api.i18n.I18nMessage mapIsNotEmpty()
I18nMessage for a Map which was expected to be empty but wasn'tI18nMessageCopyright © 2021 MuleSoft, Inc.. All rights reserved.