[ https://issues.apache.org/jira/browse/TEXT-97?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16078527#comment-16078527 ]
Amey Jadiye commented on TEXT-97: --------------------------------- In that case we have {{.selectFrom()}} API, All I'm expecting is to have different API available in different situations, I understand that only {{.selectFrom()}} is enough but others provide more flexibility to existing API. Few and selected characters : {{.selectFrom(char ... chars)}} // like "I need just few special chars" Single range : {{.withinRange(int min , int max)}} //like "I want only numeric" Multiple ranges : {{.withinRange(final char[] ... pairs)}} //like "I want alphanumeric" > 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)