commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Amey Jadiye (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (TEXT-97) RandomStringGenerator should be able to pass multiple ranges to .withinRange()
Date Sat, 01 Jul 2017 18:50:00 GMT

    [ https://issues.apache.org/jira/browse/TEXT-97?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16071366#comment-16071366
] 

Amey Jadiye commented on TEXT-97:
---------------------------------

Agree, usual use cases are numeric, alphabetic and alphanumeric and we can have those robust
methods as well since they are very handy but those should call {{.withinRange(char[] ...)}}
that's what I expect. so if someone in future would needs another range like "I want alphanumeric
plus special char" will eventually use this API. {code}{{'!','-'},{'0','9'},{'A','Z'},{'a','z'}}{code}

http://www.asciitbl.com/_site_media/ascii/ascii-table-landscape.jpg

> 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)

Mime
View raw message