commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ameyjadiye <...@git.apache.org>
Subject [GitHub] commons-text pull request #62: TEXT-101: Moved RandomStringUtils to Commons-...
Date Mon, 25 Sep 2017 17:31:11 GMT
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



---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


Mime
View raw message