mustHaveAtLeastOneOfEach property

bool mustHaveAtLeastOneOfEach
getter/setter pair

This boolean flag is maybe the most interesting thing about this string generator. Here's how it works:

Once you set it to TRUE, the generated string will have at least one character of each "has" boolean property types, and alpha case together.

Also, now you must specify a minimum string length that is at least equal to the number of "one of each" characters that you specify.

Example use case 1:

RandomStringGenerator(
  mustHaveAtLeastOneOfEach: true,
  hasAlpha: true,
  alphaCase: AlphaCase.MIXED,
  hasDigits: true,
  hasSymbols: true,
  length: 4,
);

This generated a string that has alpha characters (upper and lower), digits, symbols, and it is guaranteed that it has at least one of the aforementioned characters. Now you must specify the length to be at least 4, because you cannot say that you want a string that has at least one of each character type, which means at least 4 chars, and then provide a length lower than 4

Example use case 2:

RandomStringGenerator(
  mustHaveAtLeastOneOfEach: false,
  hasAlpha: true,
  alphaCase: AlphaCase.MIXED,
  hasDigits: true,
  hasSymbols: true,
  length: 1,
);

Once you set "mustHaveAtLeastOneOfEach" to FALSE, you can set any value >= 1 as the length because it doesn't need to have at least one of each anymore. It will just generate randomly.

Implementation

bool mustHaveAtLeastOneOfEach;