Interface StringGeneratorSpec

All Superinterfaces:
GeneratorSpec<String>, NullableGeneratorSpec<String>
All Known Subinterfaces:
StringSpec
All Known Implementing Classes:
StringGenerator

public interface StringGeneratorSpec extends NullableGeneratorSpec<String>
Generator spec for Strings.
Since:
1.0.1
  • Method Details

    • prefix

      StringGeneratorSpec prefix(String prefix)
      Specifies the prefix to prepend to generated strings.
      Parameters:
      prefix - for generated strings
      Returns:
      spec builder
    • suffix

      StringGeneratorSpec suffix(String suffix)
      Specifies the suffix to append to generated strings.
      Parameters:
      suffix - for generated strings
      Returns:
      spec builder
      Since:
      2.7.0
    • allowEmpty

      StringGeneratorSpec allowEmpty()
      Indicates that an empty string can be generated.
      Returns:
      spec builder
    • allowEmpty

      StringGeneratorSpec allowEmpty(boolean isAllowed)
      Indicates if empty string can be generated.
      Parameters:
      isAllowed - if true, empty strings can be generated
      Returns:
      spec builder
      Since:
      2.7.0
    • length

      StringGeneratorSpec length(int length)
      Length of string to generate.
      Parameters:
      length - exact length to generate
      Returns:
      spec builder
    • length

      StringGeneratorSpec length(int minLength, int maxLength)
      Length of string to generate.
      Parameters:
      minLength - minimum length (inclusive)
      maxLength - maximum length (inclusive)
      Returns:
      spec builder
    • minLength

      StringGeneratorSpec minLength(int length)
      Minimum length of string to generate.
      Parameters:
      length - minimum length (inclusive)
      Returns:
      spec builder
    • maxLength

      StringGeneratorSpec maxLength(int length)
      Maximum length of string to generate.
      Parameters:
      length - maximum length (inclusive)
      Returns:
      spec builder
    • lowerCase

      StringGeneratorSpec lowerCase()
      Generates a lower case string.
      Returns:
      spec builder
    • upperCase

      StringGeneratorSpec upperCase()
      Generates an upper case string.
      Returns:
      spec builder
    • mixedCase

      StringGeneratorSpec mixedCase()
      Generates a mixed case string.
      Returns:
      spec builder
    • alphaNumeric

      StringGeneratorSpec alphaNumeric()
      Generates an alphanumeric string, upper case by default.
      Returns:
      spec builder
    • digits

      Generates a string comprised of only digits.
      Returns:
      spec builder
    • hex

      Generates a hexadecimal string, upper case by default.
      Returns:
      spec builder
      Since:
      2.11.0
    • nullable

      Description copied from interface: NullableGeneratorSpec
      Indicates that null value can be generated.
      Specified by:
      nullable in interface NullableGeneratorSpec<String>
      Returns:
      spec builder