Class TextLanguageValidationsBuilder

java.lang.Object
com.shaft.validation.internal.TextLanguageValidationsBuilder

public class TextLanguageValidationsBuilder extends Object
Fluent builder for validating text language by character-set detection.
  • 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

      public ValidationsExecutor is(String languageCode)
      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

      public ValidationsExecutor isNot(String languageCode)
      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