Last active
February 9, 2018 21:30
-
-
Save bandrzejczak/d20ecb8d90ddacde832d9b93de199c2b 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
Integer getSongLength(Artist artist, String albumName, String songName){ | |
return artist | |
.getAlbum(albumName) | |
.map(a -> a.getSong(songName)) | |
.map(Song::getTime) | |
.orElseThrow(() -> new NoSuchSongException(artist, albumName, songName)); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment