[functor] [PATCH] Add predicates

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

[functor] [PATCH] Add predicates

Bruno P. Kinoshita
Hi all,

FUNCTOR-30 [1] contains a patch for [functor] that I'd like to merge. I will spend one or two other days reviewing the code style & tests, and will wait till the middle of the week before merging, so that others can take some time to review too.
The patch provides several predicates to use with Strings, such as IsNull, IsAlpha, IsAlphanumeric, etc. Most of them calling existing methods in [lang]'s StringUtils.

All the best,Bruno
[1] https://issues.apache.org/jira/browse/FUNCTOR-30
 
Reply | Threaded
Open this post in threaded view
|

Re: [functor] [PATCH] Add predicates

Benedikt Ritter-3
Hi Bruno,

Send from my mobile device

> Am 11.04.2015 um 12:21 schrieb Bruno P. Kinoshita <[hidden email]>:
>
> Hi all,
>
> FUNCTOR-30 [1] contains a patch for [functor] that I'd like to merge. I will spend one or two other days reviewing the code style & tests, and will wait till the middle of the week before merging, so that others can take some time to review too.
> The patch provides several predicates to use with Strings, such as IsNull, IsAlpha, IsAlphanumeric, etc. Most of them calling existing methods in [lang]'s StringUtils.
>

Nice to see same action in the functor component again. Does functor have a dependency on lang? Usually we try not to have dependencies between components...

Further more I don't really see the use case for this addtion. Releasing functor for Java 7 doesn't make much sense to me. Functor and Java 8 lambdas are a perfect match. But if we target Java 8, one could simply write:

StringUtils::isEmpty

No need to define a separate predicate implementation...

br,
Benedikt

> All the best,Bruno
> [1] https://issues.apache.org/jira/browse/FUNCTOR-30
>  

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: [functor] [PATCH] Add predicates

Bruno P. Kinoshita
Hi Benedikt,
> Nice to see same action in the functor component again. Does functor have a dependency on lang? Usually we try not to have dependencies between components...
Indeed!

Yes it does. It was used mainly for validating method parameters, using ValidationUtils if I recall correctly. However, during build [lang] API is shaded.

> Further more I don't really see the use case for this addtion. Releasing functor for Java 7 doesn't make much sense to me. Functor and Java 8 lambdas are a perfect match. But if we target Java 8, one could simply write
Excellent feedback Benedikt! I'm not up to date to Java 8 - still working in a bunch of projects with Java6 and 7. I'll take a further look at the existing predicates in Java 8 to investigate whether it makes sense to include all the predicates in the patch or not.

Thanks a lot!Bruno

 
      From: Benedikt Ritter <[hidden email]>
 To: Commons Developers List <[hidden email]>
 Sent: Sunday, April 12, 2015 10:48 PM
 Subject: Re: [functor] [PATCH] Add predicates
   
Hi Bruno,

Send from my mobile device

> Am 11.04.2015 um 12:21 schrieb Bruno P. Kinoshita <[hidden email]>:
>
> Hi all,
>
> FUNCTOR-30 [1] contains a patch for [functor] that I'd like to merge. I will spend one or two other days reviewing the code style & tests, and will wait till the middle of the week before merging, so that others can take some time to review too.
> The patch provides several predicates to use with Strings, such as IsNull, IsAlpha, IsAlphanumeric, etc. Most of them calling existing methods in [lang]'s StringUtils.
>

Nice to see same action in the functor component again. Does functor have a dependency on lang? Usually we try not to have dependencies between components...

Further more I don't really see the use case for this addtion. Releasing functor for Java 7 doesn't make much sense to me. Functor and Java 8 lambdas are a perfect match. But if we target Java 8, one could simply write:

StringUtils::isEmpty

No need to define a separate predicate implementation...

br,
Benedikt



> All the best,Bruno
> [1] https://issues.apache.org/jira/browse/FUNCTOR-30


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]