[jira] [Comment Edited] (TEXT-93) RandomStringGenerator accepts a list of valid characters

2017-06-23 Thread Wilson MacGyver (JIRA)

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

Wilson MacGyver edited comment on TEXT-93 at 6/23/17 6:34 PM:
--

never mind. I misunderstood the comment above. my bad, sorry. 


was (Author: wmacgyver):
--the primary argument for selectFromList is 

in https://commons.apache.org/proper/commons-lang/javadocs/api-3.6/

Deprecated. 
as of 3.6, use commons-text RandomStringGenerator instead

having selectFromList  reduce user's pain to switch. Because you know what 
happens when you make it hard to switch, people will just keep using the old 
depreciated one--


never mind. I misunderstood the comment above. my bad, sorry

> RandomStringGenerator accepts a list of valid characters
> 
>
> Key: TEXT-93
> URL: https://issues.apache.org/jira/browse/TEXT-93
> Project: Commons Text
>  Issue Type: Wish
>Reporter: Wilson MacGyver
>
>  implement a "selectFrom" feature:
>   RandomStringGenerator gen = new RandomStringGenerator.Builder()
> .selectFrom(charArray)
> .build();
> so we can pass a list of valid characters



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


[jira] [Comment Edited] (TEXT-93) RandomStringGenerator accepts a list of valid characters

2017-06-23 Thread Wilson MacGyver (JIRA)

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

Wilson MacGyver edited comment on TEXT-93 at 6/23/17 6:33 PM:
--

--the primary argument for selectFromList is 

in https://commons.apache.org/proper/commons-lang/javadocs/api-3.6/

Deprecated. 
as of 3.6, use commons-text RandomStringGenerator instead

having selectFromList  reduce user's pain to switch. Because you know what 
happens when you make it hard to switch, people will just keep using the old 
depreciated one--


never mind. I misunderstood the comment above. my bad, sorry


was (Author: wmacgyver):
the primary argument for selectFromList is 

in https://commons.apache.org/proper/commons-lang/javadocs/api-3.6/

Deprecated. 
as of 3.6, use commons-text RandomStringGenerator instead

having selectFromList  reduce user's pain to switch. Because you know what 
happens when you make it hard to switch, people will just keep using the old 
depreciated one

> RandomStringGenerator accepts a list of valid characters
> 
>
> Key: TEXT-93
> URL: https://issues.apache.org/jira/browse/TEXT-93
> Project: Commons Text
>  Issue Type: Wish
>Reporter: Wilson MacGyver
>
>  implement a "selectFrom" feature:
>   RandomStringGenerator gen = new RandomStringGenerator.Builder()
> .selectFrom(charArray)
> .build();
> so we can pass a list of valid characters



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


[jira] [Comment Edited] (TEXT-93) RandomStringGenerator accepts a list of valid characters

2017-06-23 Thread Pascal Schumacher (JIRA)

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

Pascal Schumacher edited comment on TEXT-93 at 6/23/17 3:48 PM:


You can pass a char array to a char... vararg method, so an overload is not 
necessary. Imho selectFromList won't be a common usecase and can be dropped.


was (Author: pascalschumacher):
You can pass a char array to a char... vararg method, so an overload is not 
necessary. Imho selectFromList won't be commons usecase and can be dropped.

> RandomStringGenerator accepts a list of valid characters
> 
>
> Key: TEXT-93
> URL: https://issues.apache.org/jira/browse/TEXT-93
> Project: Commons Text
>  Issue Type: Wish
>Reporter: Wilson MacGyver
>
>  implement a "selectFrom" feature:
>   RandomStringGenerator gen = new RandomStringGenerator.Builder()
> .selectFrom(charArray)
> .build();
> so we can pass a list of valid characters



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


[jira] [Comment Edited] (TEXT-93) RandomStringGenerator accepts a list of valid characters

2017-06-22 Thread Pascal Schumacher (JIRA)

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

Pascal Schumacher edited comment on TEXT-93 at 6/22/17 6:45 PM:


Thanks for the suggestion.

There is a bit of overlap with RandomStringGenerator#filteredBy.

With some work you can already archive this today, e.g.

{code}
Set characters = Stream.of('a', 'b', '0').map(i -> (int) 
i).collect(Collectors.toSet());
String str = new RandomStringGenerator.Builder().filteredBy(i -> 
characters.contains(i)).build().generate(5);{code}


was (Author: pascalschumacher):
Thanks for the suggestion.

There is a bit of overlap with RandomStringGenerator#filteredBy.

With some work you can already archive this today, e.g.

{code}
Set characters = Stream.of('a', 'b', 'c').map(i -> (int) 
i).collect(Collectors.toSet());
String str = new RandomStringGenerator.Builder().filteredBy(i -> 
characters.contains(i)).build().generate(5);{code}

> RandomStringGenerator accepts a list of valid characters
> 
>
> Key: TEXT-93
> URL: https://issues.apache.org/jira/browse/TEXT-93
> Project: Commons Text
>  Issue Type: Wish
>Reporter: Wilson MacGyver
>
>  implement a "selectFrom" feature:
>   RandomStringGenerator gen = new RandomStringGenerator.Builder()
> .selectFrom(charArray)
> .build();
> so we can pass a list of valid characters



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