You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by gyfora <gi...@git.apache.org> on 2015/11/24 19:16:41 UTC

[GitHub] flink pull request: [FLINK-3075] Change Either creation method nam...

GitHub user gyfora opened a pull request:

    https://github.com/apache/flink/pull/1402

    [FLINK-3075] Change Either creation method names and expose Right/Left classes

    This PR changes the way users can create the Either objects to make it more java 8 friendly.
    
    The Either.left(left) and Either.right(right) have been renamed to createLeft and createRight respectively and now the Right and Left classes are directly exposed as well. 
    
    This is more inline with how it is in scala and avoids method name clashes when trying to reference the Either methods from java lambdas allowing to do something like:
    
    `((List<Either<String, Integer>>) l).stream().filter(Either::isLeft).map(Either::left);`

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/gyfora/flink either

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/flink/pull/1402.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #1402
    
----
commit 40bc28bc07f46defe49fea7f007f2a765f0c022d
Author: Gyula Fora <gy...@apache.org>
Date:   2015-11-24T18:00:36Z

    [FLINK-3075] Change Either creation method names and expose Right/Left classes

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] flink pull request: [FLINK-3075] Change Either creation method nam...

Posted by gyfora <gi...@git.apache.org>.
Github user gyfora commented on the pull request:

    https://github.com/apache/flink/pull/1402#issuecomment-159565868
  
    I actually prefer Either.Left(left) as well 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] flink pull request: [FLINK-3075] Change Either creation method nam...

Posted by StephanEwen <gi...@git.apache.org>.
Github user StephanEwen commented on the pull request:

    https://github.com/apache/flink/pull/1402#issuecomment-159565360
  
    I like this. Wonder if we can call the `createLeft(L value)` method just `Left(L value)` (with a capital L to disambiguate against the accessor method `left()`.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] flink pull request: [FLINK-3075] Change Either creation method nam...

Posted by gyfora <gi...@git.apache.org>.
Github user gyfora commented on the pull request:

    https://github.com/apache/flink/pull/1402#issuecomment-159571467
  
    I don't have strong feelings about having it either way (public/non-public Left Right classes) now that the static names dont clash. What do you think @StephanEwen ?



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] flink pull request: [FLINK-3075] Change Either creation method nam...

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

    https://github.com/apache/flink/pull/1402


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] flink pull request: [FLINK-3075] Change Either creation method nam...

Posted by StephanEwen <gi...@git.apache.org>.
Github user StephanEwen commented on the pull request:

    https://github.com/apache/flink/pull/1402#issuecomment-159709938
  
    I Have no strong feelings there either<R,L>. 
    
    Scala has them public, so why not simply do the same?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] flink pull request: [FLINK-3075] Change Either creation method nam...

Posted by vasia <gi...@git.apache.org>.
Github user vasia commented on the pull request:

    https://github.com/apache/flink/pull/1402#issuecomment-159566437
  
    I still think there's no reason for `Left` and `Right` to be public classes, especially if you keep the static creation methods. But, if this is just me, go ahead :)


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] flink pull request: [FLINK-3075] Change Either creation method nam...

Posted by gyfora <gi...@git.apache.org>.
Github user gyfora commented on the pull request:

    https://github.com/apache/flink/pull/1402#issuecomment-160331397
  
    I rebased it on the TypeExtractor changes. 
    
    Any objections against merging this?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---