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

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

Github user ameyjadiye commented on a diff in the pull request:

    https://github.com/apache/commons-text/pull/62#discussion_r140843601
  
    --- Diff: src/main/java/org/apache/commons/text/RandomStringGenerator.java 
---
    @@ -324,6 +324,40 @@ public Builder withinRange(final int minimumCodePoint, 
final int maximumCodePoin
     
             /**
              * <p>
    +         * Specifies the array of minimum and maximum char allowed in the
    +         * generated string.
    +         * </p>
    +         *
    +         * For example:
    +         * <pre>
    +         * {@code
    +         *     char [][] pairs = {{'0','9'}};
    +         *     char [][] pairs = {{'a','z'}};
    +         *     char [][] pairs = {{'a','z'},{'0','9'}};
    +         * }
    +         * </pre>
    +         *
    +         * @param pairs array of charachters array, expected is to pass 
min, max pairs through this arg.
    +         * @return {@code this}, to allow method chaining.
    +         */
    +        public Builder withinRange(final char[] ... pairs) {
    +            characterList = new ArrayList<Character>();
    +            for (char[] pair :  pairs) {
    +                final int minimumCodePoint = pair[0];
    +                final int maximumCodePoint = pair[1];
    --- End diff --
    
    I think we should put that for better exception handling, also check of 
```minimumCodePoint  < maximumCodePoint ```, thanks



> Move RandomStringUtils to Commons-text
> --------------------------------------
>
>                 Key: TEXT-101
>                 URL: https://issues.apache.org/jira/browse/TEXT-101
>             Project: Commons Text
>          Issue Type: Task
>            Reporter: Amey Jadiye
>             Fix For: 1.2
>
>
> This task contains not just moving but ,
> 1. Keep RandomStringUtils deprecated in commons-lang.
> 2. Move RandomStringUtils class to commons-text.
> 3. Remove all existing code from methods of RandomStringUtils and call our
> brand new RandomStringGenerator in them. to return respective values i.e.
> randomNumeric, randomAlphabetic, randomAlphanumeric etc....



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to