You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@beam.apache.org by Wesley Tanaka <wt...@yahoo.com.INVALID> on 2017/05/25 05:40:39 UTC

SerializableFunction composition operator

Does the Java API have a composition operator for SerializableFunction?  It seems like these two compositions in particular might tend to pop up from time to time:

myFunction(KV::getValue(x))
myFunction(KV::getKey(x))


If there isn't already one, would there be interest in a contribution of one, or is it too trivial?

https://github.com/wtanaka/streaming/pull/86/files




---
Wesley Tanaka
https://wtanaka.com/

Re: SerializableFunction composition operator

Posted by Kenneth Knowles <kl...@google.com.INVALID>.
Hi Wesley,

It does seem useful to have combinators for SerializationFunction like you
would expect for any function. One limitation to making this really nice is
that we want to continue to be Java 7 compatible, so it is not possible to
add method bodies to the interface.

Kenn

On Wed, May 24, 2017 at 10:40 PM, Wesley Tanaka <wt...@yahoo.com.invalid>
wrote:

> Does the Java API have a composition operator for SerializableFunction?
> It seems like these two compositions in particular might tend to pop up
> from time to time:
>
> myFunction(KV::getValue(x))
> myFunction(KV::getKey(x))
>
>
> If there isn't already one, would there be interest in a contribution of
> one, or is it too trivial?
>
> https://github.com/wtanaka/streaming/pull/86/files
>
>
>
>
> ---
> Wesley Tanaka
> https://wtanaka.com/