Class TextLanguageValidationsBuilder
java.lang.Object
com.shaft.validation.internal.TextLanguageValidationsBuilder
Fluent builder for validating text language by character-set detection.
-
Method Summary
Modifier and TypeMethodDescriptionis(ValidationEnums.TextLanguage language) Validates that the target text contains characters from the selected language preset.Validates that the target text matches a supported language code.isNot(ValidationEnums.TextLanguage language) Validates that the target text does not contain characters from the selected language preset.Validates that the target text does not match a supported language code.
-
Method Details
-
is
Validates that the target text contains characters from the selected language preset.- Parameters:
language- expected language preset- Returns:
- validations executor for optional custom message and perform
-
isNot
Validates that the target text does not contain characters from the selected language preset.- Parameters:
language- unexpected language preset- Returns:
- validations executor for optional custom message and perform
-
is
Validates that the target text matches a supported language code.- Parameters:
languageCode- two-letter language code (e.g., ar, en, es, fr, de)- Returns:
- validations executor for optional custom message and perform
- Throws:
IllegalArgumentException- when the language code is unsupported
-
isNot
Validates that the target text does not match a supported language code.- Parameters:
languageCode- two-letter language code (e.g., ar, en, es, fr, de)- Returns:
- validations executor for optional custom message and perform
- Throws:
IllegalArgumentException- when the language code is unsupported
-