LANG-1224: Extend RandomStringUtils with methods that generate strings between a min and max length

add missing since javadoc tags
This commit is contained in:
pascalschumacher 2016-08-21 15:50:31 +02:00
parent ec2fa6bd56
commit a06c99b9c0
1 changed files with 6 additions and 0 deletions

View File

@ -92,6 +92,7 @@ public static String randomAscii(final int count) {
* @param minLengthInclusive the inclusive minimum length of the string to generate * @param minLengthInclusive the inclusive minimum length of the string to generate
* @param maxLengthExclusive the exclusive maximum length of the string to generate * @param maxLengthExclusive the exclusive maximum length of the string to generate
* @return the random string * @return the random string
* @since 3.5
*/ */
public static String randomAscii(final int minLengthInclusive, final int maxLengthExclusive) { public static String randomAscii(final int minLengthInclusive, final int maxLengthExclusive) {
return randomAscii(RandomUtils.nextInt(minLengthInclusive, maxLengthExclusive)); return randomAscii(RandomUtils.nextInt(minLengthInclusive, maxLengthExclusive));
@ -120,6 +121,7 @@ public static String randomAlphabetic(final int count) {
* @param minLengthInclusive the inclusive minimum length of the string to generate * @param minLengthInclusive the inclusive minimum length of the string to generate
* @param maxLengthExclusive the exclusive maximum length of the string to generate * @param maxLengthExclusive the exclusive maximum length of the string to generate
* @return the random string * @return the random string
* @since 3.5
*/ */
public static String randomAlphabetic(final int minLengthInclusive, final int maxLengthExclusive) { public static String randomAlphabetic(final int minLengthInclusive, final int maxLengthExclusive) {
return randomAlphabetic(RandomUtils.nextInt(minLengthInclusive, maxLengthExclusive)); return randomAlphabetic(RandomUtils.nextInt(minLengthInclusive, maxLengthExclusive));
@ -148,6 +150,7 @@ public static String randomAlphanumeric(final int count) {
* @param minLengthInclusive the inclusive minimum length of the string to generate * @param minLengthInclusive the inclusive minimum length of the string to generate
* @param maxLengthExclusive the exclusive maximum length of the string to generate * @param maxLengthExclusive the exclusive maximum length of the string to generate
* @return the random string * @return the random string
* @since 3.5
*/ */
public static String randomAlphanumeric(final int minLengthInclusive, final int maxLengthExclusive) { public static String randomAlphanumeric(final int minLengthInclusive, final int maxLengthExclusive) {
return randomAlphanumeric(RandomUtils.nextInt(minLengthInclusive, maxLengthExclusive)); return randomAlphanumeric(RandomUtils.nextInt(minLengthInclusive, maxLengthExclusive));
@ -177,6 +180,7 @@ public static String randomGraph(final int count) {
* @param minLengthInclusive the inclusive minimum length of the string to generate * @param minLengthInclusive the inclusive minimum length of the string to generate
* @param maxLengthExclusive the exclusive maximum length of the string to generate * @param maxLengthExclusive the exclusive maximum length of the string to generate
* @return the random string * @return the random string
* @since 3.5
*/ */
public static String randomGraph(final int minLengthInclusive, final int maxLengthExclusive) { public static String randomGraph(final int minLengthInclusive, final int maxLengthExclusive) {
return randomGraph(RandomUtils.nextInt(minLengthInclusive, maxLengthExclusive)); return randomGraph(RandomUtils.nextInt(minLengthInclusive, maxLengthExclusive));
@ -205,6 +209,7 @@ public static String randomNumeric(final int count) {
* @param minLengthInclusive the inclusive minimum length of the string to generate * @param minLengthInclusive the inclusive minimum length of the string to generate
* @param maxLengthExclusive the exclusive maximum length of the string to generate * @param maxLengthExclusive the exclusive maximum length of the string to generate
* @return the random string * @return the random string
* @since 3.5
*/ */
public static String randomNumeric(final int minLengthInclusive, final int maxLengthExclusive) { public static String randomNumeric(final int minLengthInclusive, final int maxLengthExclusive) {
return randomNumeric(RandomUtils.nextInt(minLengthInclusive, maxLengthExclusive)); return randomNumeric(RandomUtils.nextInt(minLengthInclusive, maxLengthExclusive));
@ -234,6 +239,7 @@ public static String randomPrint(final int count) {
* @param minLengthInclusive the inclusive minimum length of the string to generate * @param minLengthInclusive the inclusive minimum length of the string to generate
* @param maxLengthExclusive the exclusive maximum length of the string to generate * @param maxLengthExclusive the exclusive maximum length of the string to generate
* @return the random string * @return the random string
* @since 3.5
*/ */
public static String randomPrint(final int minLengthInclusive, final int maxLengthExclusive) { public static String randomPrint(final int minLengthInclusive, final int maxLengthExclusive) {
return randomPrint(RandomUtils.nextInt(minLengthInclusive, maxLengthExclusive)); return randomPrint(RandomUtils.nextInt(minLengthInclusive, maxLengthExclusive));