Examples of MusicLibrary


Examples of it.unipd.netmus.server.persistent.MusicLibrary

     * tutte le votazione effettuate su quella canzone.
     */
    @Override
    public double rateSong(String user, SongSummaryDTO song, int rating) {
        UserAccount userAccount = UserAccount.load(user);
        MusicLibrary library = userAccount.getMusicLibrary();
        library.rateSong(Song.loadFromDTO(song), rating);
        return Song.loadFromDTO(song).getRatingDouble();
    }
View Full Code Here

Examples of org.adoptopenjdk.lambda.tutorial.exercise5.musicplayer.MusicLibrary

     * @see MusicLibrary.SongByArtistSorter#sort(java.util.Collection)
     *
     */
    @Test
    public void useDefaultMethodToReturnPlaylistOrderedByArtist() {
        MusicLibrary library = new LocalFilesystemMusicLibrary(
            new Song("A Change Is Gonna Come", "Sam Cooke"),
            new Song("Bad Moon Rising", "Creedence Clearwater Revival"),
            new Song("Candy", "Paulo Nutini"),
            new Song("Desolation Row", "Bob Dylan"),
            new Song("Eleanor Rigby", "The Beatles")
View Full Code Here

Examples of org.adoptopenjdk.lambda.tutorial.exercise5.musicplayer.MusicLibrary

     * @see MusicLibrary#ratingOf(Song)
     * @see CloudScrobblingMusicLibrary.CloudScrobblingService#retrieveScrobbledRatingOf(Song)
     */
    @Test
    public void overridesDefaultMethodInClassToProvideCustomSongRatingAlgorithm() {
        MusicLibrary library = new CloudScrobblingMusicLibrary();

        assertThat(library.ratingOf(new Song("Candy", "Paulo Nutini")), is(new Rating(78)));
        assertThat(CloudScrobblingMusicLibrary.class, HasConcreteMethod.called("ratingOf"));
    }
View Full Code Here

Examples of org.adoptopenjdk.lambda.tutorial.exercise5.musicplayer.MusicLibrary

     * to a Rating type with the {@link UserRatedMusicLibrary.StarRatingConverter#convert(StarRating)} method.
     *
     */
    @Test
    public void overrideDefaultMethodInInterfaceToProvideUserEnteredSongRatings() {
        MusicLibrary library = new UserRatedLocalFilesystemMusicLibrary();

        assertThat(library.ratingOf(new Song("Desolation Row", "Bob Dylan")), is(new Rating(60)));
        assertThat(UserRatedMusicLibrary.class, HasConcreteMethod.called("ratingOf"));
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.