[ https://issues.apache.org/jira/browse/TEXT-97?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16071334#comment-16071334 ]
Amey Jadiye commented on TEXT-97: --------------------------------- Hi, Primary motivation to write this method was to have single API which will return random string with given multiple ranges, writing helper method is ok but not as nice as having single line code giving you output. Thanks for inputs you gave for mote Validation Cases I can put those to PR. * Checking input is exact N*2 * Lenght check * Will think some more before commit .... > RandomStringGenerator should be able to pass multiple ranges to .withinRange() > ------------------------------------------------------------------------------ > > Key: TEXT-97 > URL: https://issues.apache.org/jira/browse/TEXT-97 > Project: Commons Text > Issue Type: Improvement > Reporter: Amey Jadiye > Fix For: 1.2 > > > Users should have ability to pass multiple ranges to generate desired output. > Ex. For > *.randomNumeric()* > {code} > char [][] ranges = {{'0','9'}}; > RandomStringGenerator generator = new > RandomStringGenerator.Builder().withinRange(ranges).build(); > {code} > *.randomAlphabetic()* > {code} > char [][] ranges = {{'A','Z'}}; // or {{'A','Z'},{'a','z'}} > RandomStringGenerator generator = new > RandomStringGenerator.Builder().withinRange(ranges).build(); > {code} > *.randomAlphanumeric()* > {code} > char [][] ranges = {{'0','9'},{'A','Z'},{'a','b'}}; > RandomStringGenerator generator = new > RandomStringGenerator.Builder().withinRange(ranges).build(); > {code} -- This message was sent by Atlassian JIRA (v6.4.14#64029)