You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2017/07/01 15:00:01 UTC

[jira] [Commented] (TEXT-97) RandomStringGenerator should be able to pass multiple ranges to .withinRange()

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

ASF GitHub Bot commented on TEXT-97:
------------------------------------

GitHub user ameyjadiye opened a pull request:

    https://github.com/apache/commons-text/pull/55

    TEXT-97: RandomStringGenerator able to pass multiple ranges to .withinRange()

    *.withinRange()* now able to accept multiple ranges.
    
    Ex.
    ```
    final char [][] pairs = {{'a','z'},{'0','9'}};
    RandomStringGenerator generator = new RandomStringGenerator.Builder().withinRange(pairs).build();
    ```

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/ameyjadiye/commons-text TEXT-97

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/commons-text/pull/55.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #55
    
----
commit beb0b4615a94420cc86595c1f060711dd999af91
Author: Amey Jadiye <am...@gmail.com>
Date:   2017-07-01T14:55:35Z

    RandomStringGenerator able to pass multiple ranges to .withinRange()

----


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