Created
September 23, 2016 14:51
-
-
Save sumew/66c1ada0a1eb50b201c3a12503d56850 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Number plusOne = Match(obj).of( | |
Case(instanceOf(Integer.class), i -> i + 1), | |
Case(instanceOf(Double.class), d -> d + 1), | |
Case($(), o -> { throw new NumberFormatException(); }) | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment